We use the ExtendedTableDataModel for paging. This is done to retrieve a set of results with Hibernate and load the next set when another page is requested.
All works fine, but if we sort columns by using rich:column sortBy within the rich:dataTable then RichFaces tries to load all rows. We can see this while debugging the getItemsByRange which we made for our custom DataProvider. After clicking sort once, RichFaces will continue to retrieve all rows from the database. This is of course not what we want. We wanted to use this solution to minimize the data traffic and load times.
We use Richfaces 3.3.2. Is there someone with a possible solution or workaround?
We had the same problem, and here's our solution. I'm not entirely sure that the whole code I'm pasting is relevant, but it should be
And you also need a custom
DataProvider
In the method
getItemsByRange
make your query load only a limited amount of records. All other methods should be straightforward to implement (I'm not pasting our code, because it is full of quite specific code, which is not relevant)And you construct your data model as follows: