File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Maintain table checkboxes state after sorting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Maintain table checkboxes state after sorting" Watch "Maintain table checkboxes state after sorting" New topic

Maintain table checkboxes state after sorting

Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84


Table with say 50 rows & 8 columns(3 sortable) where as each row has unique id which assigned to each checkbox. When some checkboxes selected say '5' & perform sorting, need to maintain a selected checkboxes state.

[1] Data is acquired from model layer in concern action class.
[2] Populating bean object with 50 row's data <note bean class is having property name(s) for each column(s)>
[3] Please note bean object does not have any property for checkbox column.
[4] Bean object(s) is added to ArrayList in action & set in request scope.
[5] Corresponding Jsp iterates the bean object(s) which set in request scope & display it (including checkbox).

In this case, how i can maintain the state of checkboxes after sorting? I am not sure whether the above developed flow is correct or not since am not using the form properly. However, I have searched in this regard in java ranch forum & net. Still i didnt get proper solution. can anybody share a better example for this which will help lots of people.

I agree. Here's the link:
subject: Maintain table checkboxes state after sorting
It's not a secret anymore!