This content has been marked as final.
Show 2 replies
-
1. Re: How to custom sort in columns always displaying null values at the end
terryo Nov 3, 2009 7:52 PM (in response to aogier.netangel+seamframework.gmail.com)A bit of a hack, but you can provide a label for the column and
pass it to this method. This order can then be passed to your comparator.
I am sure there are better ways, but this at least gets you the column sort order.private Ordering getColumnSortOrder (String columnLabel) { FacesContext facesContext = FacesContext.getCurrentInstance(); HtmlDataTable htmlDataTable = (HtmlDataTable)facesContext.getViewRoot().findComponent("formId:tableId"); Iterator<UIComponent> columns = htmlDataTable.columns(); while (columns.hasNext()) { HtmlColumn column = (HtmlColumn) columns.next(); String label = column.getLabel(); if (StringUtils.equals(columnLabel, label)) { Ordering order = column.getSortOrder(); return order; } } return Ordering.UNSORTED; }
-
2. Re: How to custom sort in columns always displaying null values at the end
siva999 Apr 7, 2011 4:12 PM (in response to aogier.netangel+seamframework.gmail.com)Hi Anthony,
I also need same funtionality. I am wondering whether you are able to resolve this issue and how?Siva