This content has been marked as final.
Show 3 replies
-
1. Re: Sorting and selection in scrollableDataTable
ilya_shaikovsky Apr 25, 2009 2:37 AM (in response to tw)http://livedemo.exadel.com/richfaces-demo/richfaces/scrollableDataTable.jsf
nothing wrong with selection after sorting. -
2. Re: Sorting and selection in scrollableDataTable
konstantin.mishin Apr 25, 2009 4:27 AM (in response to tw)We don't sort your backing list. If you wish to sort it you should use your custom model as value.
-
3. Re: Sorting and selection in scrollableDataTable
tw Apr 30, 2009 10:09 PM (in response to tw)In case anybody is looking for this, here is an example (would be helpful to have this somewhere in the documentation or KB):
// sortExpression="#{someComponent.getSortValues(rowId)[colIndex]}" private ScrollableTableDataModel<Long> tableDataModel = new ScrollableTableDataModel<Long>() { @Override public List<Long> loadData(int startRow, int endRow, SortOrder sortOrder) { // this method is called twice in the case of sorting: first during decode and then during encode, with sort order if (sortOrder != null) { ScrollableTableDataModel sortableModel = new org.richfaces.model.internal.ComponentSortableDataModel("rowId", rowIds, sortOrder); return sortableModel.loadData(startRow, endRow, sortOrder); } return rowIds; } @Override public int getRowCount() { if (rowIds != null) { return rowIds.size(); } return 0; } @Override public Object getWrappedData() { throw new UnsupportedOperationException(); } @Override public void setWrappedData(Object data) { throw new UnsupportedOperationException(); } @Override public Object getId(Long o) { return o.intValue(); } };