aspose file tools*
The moose likes Struts and the fly likes Retaining checkbox values across pages using struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Retaining checkbox values across pages using struts" Watch "Retaining checkbox values across pages using struts" New topic
Author

Retaining checkbox values across pages using struts

dheepak kumar
Greenhorn

Joined: Apr 11, 2006
Posts: 5
Hi ,

I have to display about a 100 records from database , 10 records per page.I am currently using the C:foreach tag and passing the begin and end values as parameters to the same page when Next,Last,Previous and First buttons are clicked.Not quite able to use logic:iterate since Struts el is not working.

I have a checkbox for each record. When I click on 'Next' the checkbox values are not retained since the page is being refreshed with new params.
I need to submit all the records in one go.

Would display tags or pager tags help me retain the values until I click the Submit button.
Hope someone could help me out on this one.

Thanks in Advance!!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
My advice is to keep the List of values in the ActionForm and put the ActionForm in session scope. You can then use Indexed properties to set the values. Just make sure that your next and previous buttons do a submit, rather than just a link.

Once the user has gone through all the pages, you can save the values to the database on the last submit.


Merrill
Consultant, Sima Solutions
dheepak kumar
Greenhorn

Joined: Apr 11, 2006
Posts: 5
Thanks for the suggestion. Shall try implementing the same.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retaining checkbox values across pages using struts