Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ADF table custom sorting

user8400258Feb 16 2015 — edited Feb 17 2015

I'm using 11.1.1.6 Jdev.

I have a <af:table> with a column, which is Number type but most of them with NULL value.

I try to create a custom sort on this column: NULL always at the bottom no matter it's ascending or descending. But I could not get it work.

Can anyone show me how to implement onSort the above logic?

Thank you

public void onSort(SortEvent sortEvent) {

             List currentSortList = sortEvent.getSortCriteria();

             SortCriterion sortCriterion = (SortCriterion)currentSortList.get(0);

                         

             List<SortCriterion> tableSortList = new ArrayList<SortCriterion>();

             SortCriterion sortCriterionReplaced = new SortCriterion(sortCriterion.getProperty(), sortCriterion.isAscending());

             tableSortList.add(sortCriterionReplaced);

             RichTable richTable = (RichTable)sortEvent.getComponent();

             richTable.setSortCriteria(tableSortList);

            

               //refresh table

             AdfFacesContext.getCurrentInstance().addPartialTarget(richTable);

}

This post has been answered by user8400258 on Feb 17 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2015
Added on Feb 16 2015
4 comments
1,823 views