Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retaining checkbox values across pages using struts

 
dheepak kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
dheepak kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestion. Shall try implementing the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic