wood burning stoves 2.0*
The moose likes Struts and the fly likes dynamic row generation in struts ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamic row generation in struts ? " Watch "dynamic row generation in struts ? " New topic
Author

dynamic row generation in struts ?

Asheesh Nehra
Ranch Hand

Joined: Jun 25, 2009
Posts: 35
I need help in row generation in jsp using struts 1. suppose i have a row having controls

list text box text box
Add new wen i click Add new one more row will generate like this

list text box text box
list text box text box

and list should have values . Also tell me that can i get all these values throgh form object?

Thanks in Advance
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Use JavaScript to make multiple new rows which consist of text box and while creating use the same name of form bean property for each new row "input" tags, but the trick is that, the form bean property MUST be an array.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Asheesh Nehra
Ranch Hand

Joined: Jun 25, 2009
Posts: 35
Thanks for your reply, my Q is how can i get lsit in new row agian as it is in request scope , using struts?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Asheesh Nehra wrote: my Q is how can i get lsit in new row agian as it is in request scope , using struts?

UseRealWords

If you want the new rows should be populated with those list values, then still you can use JS. What exactly you need to do is "clone" the previous row and "write" in into a HTML page, How to do that, Google it OR ask in HTML-JavaScript forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic row generation in struts ?
 
Similar Threads
adding an empty row to a datatable
Automatic Installation of 100+ Open Source Projects for Java Developers
Table in a List Box
cloning labels
Struts in jsp for db add and update