Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best option to update only selected rows form Struts2

 
Tony Manello
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've been stucked for for a while with this issue. I have a form which consists in a set of rows from an iterator property. Each row represent an object which consists mainly of about 30 checkboxes and 3 or 4 textfields input and it has the corresponding checkbox representing if row is select. I've been struggling in how to make only selected rows being updated once form is submitted. Value of each selected row checkbox corresponds with the index of the object to be updated in the iterator. So how can I achieve updating only the values of selected objects in the iterator?

I've thought about using a hidden value an array of selected items or something like that populated by a jquery script but I had no luck, another option I think is build a subset of the iterator list which contains only the elements to be updated. Anyone can bring a ray of light about how can achieve that functionality?

Thanks for your time
 
Joe Ess
Bartender
Pie
Posts: 9264
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you only want the selected rows submitted, you will probably have to use JavaScript to edit the form before submission. You could also have your action iterate through the form and toss out the records that were not selected before processing further.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic