-
1. Re: rich:dataTable and sortable Columns
ishabalov Mar 15, 2007 3:28 PM (in response to damianharvey)I always wonder what is "sortable column support"? Like for example you have a table, that display some data that come from some query from database. How you suppose to sort it? On client? In memory on server? On database? How you will tell to the database what column need to be sorted?
My point is that "sortable column" cannot be implemented in generic way. All mentioned usecases may take place and it is completely different. All we can do is to provide "plumbing" that allows to react to some user actions (like click on column header) and do whatever application need to do with it.
However, I guess we owe some sample that show how rich:dataTable may be used in "sortable column" usecase. -
2. Re: rich:dataTable and sortable Columns
m.schuetz Mar 16, 2007 4:51 AM (in response to damianharvey)A workaround is using an actionlistener to get the column id, sort the data (by using e.g. a specialized comperator) and than rerender the list. It works fine.
-
3. Re: rich:dataTable and sortable Columns
amitev Mar 16, 2007 7:08 AM (in response to damianharvey)Maybe something like tomahawk's solution? They have name attribute on the column component and that name is passed to value expression and a bollean property for the type of sorting (ascending/descending).
-
4. Re: rich:dataTable and sortable Columns
alexsmirnov Mar 16, 2007 12:51 PM (in response to damianharvey)rich:datatable component is have hoock to easy create sortable data models. In differense with JSF UIData component, rows iterations is moved to extended data model with visitor pattern. Iteration order can be changed in model, even at HQL/SQL queries or other application-specific methods.