Reputation: 95
I tried this
<rich:dataTable value="#{myBean.cities}" var="c">
<rich:column>
<f:facet name="header">
<h:outputText value="City"></h:outputText>
</f:facet>
<h:outputText value="#{c.name}"/>
</rich:column>
<rich:column sortBy="#{c.population}">
<f:facet name="header">
<h:outputText value="Population"></h:outputText>
</f:facet>
<h:outputText value="#{c.population}"/>
</rich:column>
</rich:dataTable>
but rows aren't sorted.
cities is List<City>
, City.population
is int
Upvotes: 2
Views: 3071
Reputation: 95
I investigated that in RichFaces 3.3.3 it was enough to add <h:form> .. </h:form>
around rich:dataTable
but in RichFaces 4 I had to also add:
org.richfaces.component.SortOrder
propertiesUpvotes: 3