3 Replies Latest reply on Dec 17, 2010 7:53 AM by Andi D

    reRender in a4j:commandLink does not work

    Andi D Newbie

      Hi all,

       

      in my project I would like to show a table with my user entities in a dataTable. Furthermore, I would like to sort this table using links in the header row. My question is regarding the rerendering process, because the dataTable is not reRendered.

       

      I know that the sorting works because of a System.out but the table is not refreshed in my browser. If I reload the page (F5) then I got the sorted dataTable.


      I am using the richfaces version 4.0.0.20101110-M4 on the JBoss 6.0.0.20101110-CR1.

       

      <h:form id="form">
          <h:panelGroup id="panel">
              <f:facet name="header">USER PANEL</f:facet>
              <div id="div">
                  <rich:dataTable var="user" value="#{appUserList.resultList}" id="dataTable" >
      
                      <rich:column>
                          <f:facet name="header">
                            <a4j:commandLink id="sortId" value="#{messages.id} LINK"
                                reRender="dataTable" 
                                action="#{appUserList.updateResultList(null,'id','asc')}" >
                            </a4j:commandLink>
                          </f:facet>
                          <h:outputText value="#{user.id}" />
                      </rich:column>
                      
                      <rich:column>
                          <f:facet name="header">
                            <a4j:commandLink id="sortExtId" value="#{messages.externalId} LINK"
                                reRender="dataTable" 
                                action="#{appUserList.updateResultList(null,'externalId','asc')}" >
                            </a4j:commandLink>
                          </f:facet>
                          <h:outputText value="#{user.externalId}" />
                      </rich:column>
                      
                  </rich:dataTable>
              </div>
          </h:panelGroup>
      </h:form>
      

       

      How can I reload the sorted entities in my table?

       

      I tried this also with rich:list and a4j:commandButton.