Hi people,
I'm developing a website with JSF and richfaces for some time now and recently I found out that the sorting feature of all the rich:dataTable stop working with no apparent reason. I was assuming that the EJB integration recently added was the one to blame, but even with earlier versions with no EJB support the error appears. I was using the version 3.3.1 GA and switched to the version 3.3.3 Final, but the problem persists.
It happens as follows: I have a form to trigger a search in the database to populate the DataModel for the table. The rich:dataTable is in another form along with 2 dataScrollers. The table loads fine, and the dataScrollers work fine too, but when I try to sort any of the columns, the data in the table disappears. This happens on all the dataTables in my applications, no matter if it is tiny or heavy loaded. No error appears in the java or javascript console, and I have no clue what can cause this.
This is the code of one of the simplest dataTables I have:
<h:form>
<h:outputText id="errorMessage" value="#{userRegisterBean.errorMessage}" escape="false" />
<a4j:keepAlive beanName="userRegisterBean"/>
<c:if test="#{userRegisterBean.hasUsers}">
<rich:datascroller renderIfSinglePage="false" align="center" for="userList" maxPages="20" reRender="sc2" id="sc1" />
<rich:dataTable value="#{userRegisterBean.users}" var="dataItem" id="userList" rows="20" width="920" >
<!--onRowMouseOver="this.style.backgroundColor='#B5F3F'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}'"
width="350"
rowClasses="row1, row2" rows="4" columnClasses="50,100,100,100" width="350" -->
<rich:column sortBy="#{dataItem.company.name}" >
<f:facet name="header">
<h:outputText value="#{msg['commons.general.company']}" />
</f:facet>
<h:outputText value="#{dataItem.company.name}" />
</rich:column>
<rich:column sortBy="#{dataItem.name}">
<f:facet name="header">
<h:outputText value="#{msg['commons.user.name']}" />
</f:facet>
<h:outputText value="#{dataItem.name}" />
</rich:column>
<rich:column sortBy="#{dataItem.login}">
<f:facet name="header">
<h:outputText value="#{msg['commons.user.login']}" />
</f:facet>
<h:outputText value="#{dataItem.login}" />
</rich:column>
<rich:column sortBy="#{dataItem.email}">
<f:facet name="header">
<h:outputText value="#{msg['commons.user.email']}" />
</f:facet>
<h:outputText value="#{dataItem.email}" />
</rich:column>
<rich:column width="50">
<f:facet name="header">
<h:outputText value="#{msg['commons.general.edit']}" />
</f:facet>
<div align="center">
<h:commandLink action="#{userRegisterBean.doEdit}" >
<img src="${facesContext.externalContext.request.contextPath}/images/edit.gif"
width="16" height="16" title="#{msg['commons.general.edit']}"/>
</h:commandLink>
</div>
</rich:column>
<rich:column width="50">
<f:facet name="header">
<h:outputText value="#{msg['commons.general.delete']}" />
</f:facet>
<div align="center">
<h:commandLink action="#{userRegisterBean.doExclude}" rendered="#{dataItem.active}"
onclick="javascript:return(confirm('#{msg['page.userRegister.deleteMessage']}#{dataItem.name}?'))" >
<img src="${facesContext.externalContext.request.contextPath}/images/delete.gif"
width="16" height="16" title="#{msg['commons.general.deactivate']}" />
</h:commandLink>
</div>
</rich:column>
</rich:dataTable>
<rich:datascroller renderIfSinglePage="false" align="center" for="userList" maxPages="20" reRender="sc1" id="sc2" />
</c:if>
</h:form>
I'm using the following configuration: Java 1.6, Tomcat 6.0.26, MyFaces 1.2.7 (JSF 1.2) with facelets, richfaces 3.3.3, hibernate 3.4.0 GA, developed with Eclipse Galileo on Ubuntu Linux.
Can someone point me what is possibly going wrong? I've googled a lot and found nothing interesting...
Thank you.