开发者

Rich:dataTable sort dont update managed

开发者 https://www.devze.com 2023-03-26 04:26 出处:网络
In my application, I have a list of records. The user can select any record, updating a menu of options. The table shows that these records, it has paging.

In my application, I have a list of records. The user can select any record, updating a menu of options. The table shows that these records, it has paging.

So the problem is that when I select a record, and sort the list (making the record I had selected before go to another page), I lose sight of the selected record.

I wanted after ordering, have selected the correct page.

Ok, so I created a method to this: Figure out which page should be selected, and update the pager.

This method would work perfectly if the richfaces table also ordered the List from the managed, instead of ordering only the table on the client side.

So is there any way (without a lot of workaround) I could update the List from the开发者_如何学C managed well?

thanks.


Have you try to bind your dataTable value to ExtendedTableDataModel ? Use a org.richfaces.model.DataProvider to provide data to the ExtendedTableDataModel.

E.g. for type XXX :

ArrayList<XXX> values = ...;
XXXDataProvider xxxDataProvider = new XXXDataProvider(values);
ExtendedTableDataModel<XXX> xxxDataModel = new ExtendedTableDataModel<XXX>(xxxDataProvider);

Even if the dataTable is sorting on the client side, you should get back the right object.

I hope this will help you...

0

精彩评论

暂无评论...
验证码 换一张
取 消