tags:

views:

2825

answers:

4

Hi there,

does anyone know how to properly enable sorting on a rich:dataTable with columns generated on the fly using rich:columns tag?

Setting sortBy with an expression like #{row[column]} doesn't work for me.

I'm using RichFaces 3.3.1GA.

Here's the example:

<rich:dataTable id="table" value="#{localeHandler.locales}" var="row">
    <rich:columns value="#{localeHandler.columns}" var="column" sortBy="#{row[column]}" >
        <f:facet name="header">
            <h:outputText value="#{column}"/>
        </f:facet>
        <h:outputText value="#{row[column]}"/>
    </rich:columns>
</rich:dataTable>

whereas the localeHandler.locales is an ArrayList and localeHandler.columns is just an ArrayList containing the following values:

language, country, variant, displayName, displayLanguage, displayCountry, displayVariant
+1  A: 

I've found out that the last version where this feature worked was 3.3.0.CR1 - since 3.3.0.CR2 it's broken.

Matthias Hryniszak
A: 

Please take a look at JIRA RF-6234 for workarounds.

mikalaj
for now we've sticked to version 3.3.0.CR1 for this to work properly but thanks for the update
Matthias Hryniszak
A: 

How do I use a filter in Datatable?

Tyemy
it seems like the question has been answered 5 months ago.
Bozho
Could you pass the link on this answer?
Tyemy
Welcome at StackOverflow. Please don't post a question as an answer. Use the `Ask Question` button at the right top to ask a question. Use the `Your Answer` field only to post answers on a question.
BalusC
Okay, thank you..I made the post.. Can you help?http://stackoverflow.com/questions/1927743/richcolumns-filterby
Tyemy
A: 

Try setting sortOrder to a bean property of type org.richfaces.model.Ordering for each column

Joe Masinter