问题描述
有谁知道如何正确地使用rich:columns标记动态启用在rich:dataTable上排序的列?
does anyone know how to properly enable sorting on a rich:dataTable with columns generated on the fly using rich:columns tag?
使用#{row [column]}这样的表达式设置sortBy对我不起作用.
Setting sortBy with an expression like #{row[column]} doesn't work for me.
我正在使用RichFaces 3.3.1GA.
I'm using RichFaces 3.3.1GA.
这里是例子:
<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>
而localeHandler.locales是一个ArrayList,而localeHandler.columns只是一个包含以下值的ArrayList:
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
推荐答案
我发现此功能起作用的最后一个版本是3.3.0.CR1-自3.3.0.CR2起它就坏了.
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.
这篇关于RichFaces rich:列和排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!