Dynamic DataTable are not Sortable
christophe.noel Feb 1, 2013 6:46 AMHi,
I'm using Richfaces 4.3.0RC1
The only solution to create a dynamic datatable (with a variable number of columns, as with <rich:columns> in RF 3.3.3) consists in using JSTL <c:forEach>.
(columns no more exist, ui:repeat no yet works for tables)
In that case, sorting is not working (both with dataTable and extendedDatatable built-in OR usual sorting method).
Just for illustrating, I'm copying my code here below.
Is there an alternative ? When is planned the columns or repeat support ?
Thanks a lot
<rich:extendedDataTable id="dataTable#{popId}" styleClass="fullWidthTable" var="record" selectionMode="none" value="#{viewer.getDataOperation.response.records}" rendered="#{(viewer.views[viewer.selectedView].type eq 'TABLE')}" rows="8"> <c:forEach items="#{viewer.getDataOperation.response.fields}" var="fieldName"> <rich:column sortBy="#{record[response.getId(fieldName)]}"> <f:facet name="header"> <h:outputText value="#{fieldName}" /> </f:facet> <h:outputText value="#{record[response.getId(fieldName)]}" /> </rich:column> </c:forEach> </rich:extendedDataTable>