This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes struts 2 + dynamic input + showing said input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2 + dynamic input + showing said input" Watch "struts 2 + dynamic input + showing said input" New topic
Author

struts 2 + dynamic input + showing said input

Renz Alexander
Greenhorn

Joined: Jun 11, 2010
Posts: 28
hi every one so my problem is that i have to input a collection of beans into my action. so what i want to do is for each time i click on a button i want to generate a new row of textfields but instead of just copying the previous row it changes an index on elements name like so
to


something like this or some other variation preferably with struts2 tags in jsp or via javascript/jquery

and then if something turns up like in validation and there was something wrong in the input values
i have to be able to veiw all the values but still have the functionallity of adding more rows thanks
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

This is realy more of an AJAX question then a Struts Question.
Renz Alexander
Greenhorn

Joined: Jun 11, 2010
Posts: 28
oh ok i actually did part of it with a jquery plugin here modifying that plugin to add the index and an iterator tag though i still have to post the number of columns back to counter check if the values are modified when validating or when modifying the values
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

That is a nice plugin. A diveloper I work with did something similar to this, but in AJAX. I think he used DOJO.
 
jQuery in Action, 2nd edition
 
subject: struts 2 + dynamic input + showing said input
 
Similar Threads
onchange for dynamically added rows
adding and deleting a row in html
null pointer exception in struts2...
2 dimensional array
null pointer exception in struts2