RichFaces rich:columns and sorting

荒凉一梦 提交于 2019-12-08 05:23:06

问题


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:


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




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/1119321/richfaces-richcolumns-and-sorting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!