• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Best option to update only selected rows form Struts2  RSS feed

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 9559
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.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!