File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Best option to update only selected rows form Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Best option to update only selected rows form Struts2" Watch "Best option to update only selected rows form Struts2" New topic
Author

Best option to update only selected rows form Struts2

Tony Manello
Greenhorn

Joined: Aug 11, 2010
Posts: 13
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

Joined: Oct 29, 2001
Posts: 8710
    
    6

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best option to update only selected rows form Struts2
 
Similar Threads
HTML table with multi rows and Struts 2
best approach to send data from a selected row of a table
How to retrieve value from checkbox to Action Class
Html form to form bean mapping, multiple checkboxes
getParameterMap and unselected checkboxes