-
1. Re: Sorting with richfaces 3.3
andrei_exadel Mar 5, 2009 3:49 AM (in response to priestex)Hi,
We got the issue since 3.3.0. So to fire sorting feature please follow by these points:
1. Add sortOrder attribute and bind it to property of column instance:..... List<Column> columns; class Column { org.richfaces.model.Ordering ordering; ...... }
2. Assign unique id for each column.
In result page code should be like as:<rich:dataTable value="#{reportTableView.rowList}" var="row" width="0" height="0"> <rich:columns id="t#{ind}" value="#{reportTableView.columns}" var="column" index="ind" sortBy="#{row.cellList[ind].value}" sortOrder="#{column.ordering}"> <h:outputText value="#{row.cellList[ind].displayValue}"/> </rich:columns> </rich:dataTable>
-
2. Re: Sorting with richfaces 3.3
priestex Mar 6, 2009 5:50 PM (in response to priestex)Thnx for the quick response, but I have a followup question.
In my implementation, the list of columns and the values I am displaying inside the columns come from different objects.
That is,reportTableView.columns
is the list that I iterate to know how many columns my table has. But I get the actual values fromrow.cellList
.
So my question is, which of these should have the order defined on them?
Is there some other way to make sorting work?
Will this bug be fixed in the future? -
3. Re: Sorting with richfaces 3.3
asupa Sep 29, 2009 6:01 PM (in response to priestex)With this approach sorting works only for a couple clicks...it stops sorting after that. What could be going wrong?
-
4. Re: Sorting with richfaces 3.3
ilya_shaikovsky Sep 30, 2009 4:42 AM (in response to priestex)asupa, sorry but let us see the description of your concrete problem (ideally with code snippets). Currently can't confirm this because as you could check at richfaces-demo there is no such problem.
-
5. Re: Sorting with richfaces 3.3
asupa Sep 30, 2009 12:10 PM (in response to priestex)ilya_shaikovsky, here is the code snippet. CrystalListBean has session scope. I have created
<rich:dataTable value="#{crystalListBean.dataCollection.dataRows}" var="dataRow" id="crystalTable" rendered="#{crystalListBean.showCrystalList}"> ............... <rich:columns value="#{crystalListBean.dataCollection.columns}" var="column" index="ind" id="${idg.nextid}" sortBy="#{dataRow.dataColumns[ind].value}" sortOrder="#{column.ordering}"> ............. </rich:columns> </rich:dataTable>
Here is the ordering field that i created in the column objectimport org.richfaces.model.Ordering; ....................... private Ordering ordering; public Ordering getOrdering() { return ordering; }