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.
精彩评论