开发者

Richfaces extendedDatatable sort the empty row to be the last

I am using richfac开发者_开发问答es extendedDataTable as an editable grid. The build-in sorting always sorts the empty row to be the first. I want to sort the empty row to be the last. How can I do that? Thanks,


Items in RichFaces extendedDataTable are sorted by items natural sort oder. The list items you set as value of extendedDataTable should implement interface java.lang.Comparable. You can sort the empty row to be the last by method public int compareTo(..)

You can also sort extendedDataTable by clicking on the table headers. Add property sortBy to rich:column elements:

 <rich:extendedDataTable
   value="#{task.taskList}"
   var="item" 
   ..>                                      
     <rich:column 
       sortBy="#{item.name}"
       ..>

If you click on the column header table is sorted by sortBy value.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜