tags:

views:

13

answers:

1

Hello All,

does anyone know how exactly the default sorting works in richfaces datatable columns? (using sortby)

My problem is that once a sort has been performed, the new data order is never preserved in my backing's bean data model (which makes me wonder where is this new order now stored?), that is the actual datamodel always contains just the original data.. So if say user goes to a another page and returns to what should be sorted data (using back button) , the data displays as original, not sorted.. Has anyone come across this?

also, is there a way to do server side sorting, i.e. call my own sort method upon clicking the header..?

many thanks for any advice!

A: 

also, is there a way to do server side sorting, i.e. call my own sort method upon clicking the header..?

A similar question here. look for the accepted answer.

so if say user goes to a another page and returns to what should be sorted data (using back button) , the data displays as original, not sorted.. Has anyone come across this?

Sorting is done via client side in RichFaces, so if you use the backend solution above, you can save the sorting in the bean and use it when the user returns to the page. You will have to define the bean as SessionScope or alternatively define a Singleton class that will save the sorted collection.

Odelya