开发者

Default column for sorting in richfaces

开发者 https://www.devze.com 2023-02-10 02:32 出处:网络
I have the following environment: Seam 2.2.0 GA with default richfaces version. How do I define a default column (field) for my datatable to sort the records by this field?

I have the following environment: Seam 2.2.0 GA with default richfaces version.

How do I define a default column (field) for my datatable to sort the records by this field? I tried setting a default value for the "sort" parameter in my .page.xml file but that didn't help.

In addition, my en开发者_StackOverflow社区tityList.java returns NULL when System.out.println(this.getOrderColumn()); Does this mean that sorting happens at the client side? If so, why is the entityList() called each time I re-sort the list? Thank you


I think your EntityList class must extend from EntityQuery, so you can add these two lines in the constructor of EntityList:

setOrderColumn("yourEntity.property");
setOrderDirection("asc");

or just add one line:

setOrder("yourEntity.property asc");

I know this is hard-coded, bad but works. If anyone has a better way, please share with us. Thanks.

0

精彩评论

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