This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes maintain checkbox status in pagination. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "maintain checkbox status in pagination." Watch "maintain checkbox status in pagination." New topic
Author

maintain checkbox status in pagination.

maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
i want to implement paging;results will come from DB;IN EVERY PAGE i should display 10 records;each record has checkbox;in the first page i checked 5 records and in the next page i checked another 5 records and i navigate between first page and second page the checked and unchecked results should be populated.how to maintain checkbox checked and unchecked status in pagination.
[ December 08, 2006: Message edited by: Bear Bibeault ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You would need to submit an HTTP form to move back and forth between the pages. The form post would contain the names of the checkboxes that were checked.
Before drawing the rows to the screen, you would need to match them up against the posted checkbox values to find out which ones need to be checked.

To draw an HTML checkbox with a check in it add the "checked" attribute:


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
how to maintain checked and unchecked results during pagination
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Ben Souther:
You would need to submit an HTTP form to move back and forth between the pages. The form post would contain the names of the checkboxes that were checked.
Before drawing the rows to the screen, you would need to match them up against the posted checkbox values to find out which ones need to be checked.

To draw an HTML checkbox with a check in it add the "checked" attribute:
maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
i asked you should i maintain in session??
 
Don't get me started about those stupid light bulbs.
 
subject: maintain checkbox status in pagination.
 
Similar Threads
how to retain checkbox status during pagination in struts
Maintain checked and unchecked in checkbox in pagination
Pagination?
Pagination
maintain checkbox status while doing pagination