• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best option to update only selected rows form Struts2

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic