• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Retaining checkbox values across pages using struts

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestion. Shall try implementing the same.
 
reply
    Bookmark Topic Watch Topic
  • New Topic