1

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
Matthias Hryniszak
  • 3,099
  • 3
  • 36
  • 51
  • what do you mean by doesn't work? it's showing the arrows on the columns, but it doesn't sort when the header is clicked? no arrows? no columns being rendered? – Zack Marrapese Jul 13 '09 at 14:04
  • The arrows are there - they just don't work. 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 Jul 14 '09 at 19:47

3 Answers3

2

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

1

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
  • 3,099
  • 3
  • 36
  • 51
1

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

mikalaj
  • 111
  • 1