rich:dataTable sort not working in some cases
gjeudy Jun 13, 2008 2:53 PMHi,
I have updated my richfaces libraries to 3.2.1.GA seeing there were some bug fixes on table sorting.
Here's my usecase, I figured I needed to put my datatable inside a h:form tag for it to works. The initial rendering with initial sorting works fine, however nothing happens when I click the sort triangle buttons. I have used this sorting config many times successfully but can't figure what is wrong with this one.
rdm:listDeployDbLogEntries is a custom facelet component.
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rich="http://richfaces.org/rich" xmlns:rdm="http://archinsurance.com/rdm" template="template.xhtml"> <ui:define name="body"> <h:panelGrid columns="1"> <s:span styleClass="biggerlabel">Release Package deployment status:</s:span> <s:span styleClass="label">Deployment Status for release package: #{relPkg}</s:span> <h:panelGroup> <h:outputText styleClass="label" rendered="#{empty refPkgDeployDBLogEntries}" value="Cannot find any deployment status entries for this release package: #{relPkg}" /> <h:form> <rdm:listDeployDbLogEntries /> </h:form> </h:panelGroup> </h:panelGrid> </ui:define> <!-- sidebar --> <ui:define name="sidebar"> <p><f:verbatim> </f:verbatim></p> </ui:define> </ui:composition>
facelets fragment for rdm:listDeployDbLogEntries
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:rdm="http://archinsurance.com/rdm" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:c="http://java.sun.com/jstl/core"> <rich:dataTable rendered="#{not empty refPkgDeployDBLogEntries}" value="#{refPkgDeployDBLogEntries}" var="logEntry"> <rich:column sortBy="#{logEntry.id}" sortOrder="ASCENDING"> <f:facet name="header"> <h:outputText styleClass="label" value="Deployment Id"></h:outputText> </f:facet> <h:outputText value="#{logEntry.id}"></h:outputText> </rich:column> <rich:column sortBy="#{logEntry.environment}"> <f:facet name="header"> <h:outputText styleClass="label" value="Target Environment"></h:outputText> </f:facet> <h:outputText value="#{logEntry.environment}"></h:outputText> </rich:column> <rich:column sortBy="#{logEntry.refDatabase}"> <f:facet name="header"> <h:outputText styleClass="label" value="Target database"></h:outputText> </f:facet> <h:outputText value="#{logEntry.refDatabase}"></h:outputText> </rich:column> <rich:column sortBy="#{logEntry.deploymentDate}"> <f:facet name="header"> <h:outputText styleClass="label" value="Deployment Date"></h:outputText> </f:facet> <h:outputText value="#{logEntry.deploymentDate}"></h:outputText> </rich:column> <rich:column sortBy="#{logEntry.deploymentStatus}"> <f:facet name="header"> <h:outputText styleClass="label" value="Deployment Status"></h:outputText> </f:facet> <h:outputText value="#{logEntry.deploymentStatus}"></h:outputText> </rich:column> <rich:column sortBy="#{logEntry.comments}"> <f:facet name="header"> <h:outputText styleClass="label" value="Comments"></h:outputText> </f:facet> <h:outputText value="#{logEntry.comments}"></h:outputText> </rich:column> </rich:dataTable> </ui:composition>
I know the fragment works because I included it in another page and the sorting works as expected...
Anyone can tell me what i may be doing wrong ?
Thanks,