I am using <h atatable> pagination.I want the records on the page to be sorted based on the user's choice of the column header. I want to sort only those records on the page (not the entire list). How do I do that?
I have the entire list in the session.
posted 10 years ago
I'd make the headers into commandLinks and bind methods (action) to it that sort the query when clicked on. You could set a flag for ASC/DESC. So the first time the action is called it sorts ASC then next time the action is called it toggles the variable and sorts DESC, etc. When another action is called this flag is cleared and some other is set, thus it gets sorted by that other variables.