2 Replies Latest reply on Jun 30, 2009 3:33 AM by Tim Kaufner

    rich:datatable not being rerendered after ajax-request

    Tim Kaufner Newbie

      Hi guys, I'm facing a curious problem when submitting an ajax request. Not all components (especially my datatable rich:datatable )inside my area are rerendered, although the bean is beeing called and data from database is fetched.

      Heres my jspx from where i started the ajax-request:

      <a4j:commandButton id="openPanel_#{panelId}" reRender="outPanel_#{panelId}" action="#{searchBean.show}" oncomplete="Richfaces.showModalPanel('searchObjectPanel_#{panelId}')"
       image="images/button/suchen.gif" disabled="#{viewController.isReadOnly}" immediate="true">
       <a4j:actionparam name="#{applicationScope.constants.REQUEST_SEARCHPANEL_INCLUDE}" value="true" assignTo="#{searchBean.include}" />
      </a4j:commandButton>
      
      <a4j:outputPanel id="outPanel_#{panelId}">
       <rich:modalPanel rendered="#{searchBean.include == applicationScope.constants.TRUE}" id="searchObjectPanel_#{panelId}" zindex="2000" width="800" height="600" showWhenRendered="false">
       <f:facet name="header">#{msg['ui.searchfor.title']} #{msg[searchBean.propertyLabel]}
       </f:facet>
       <a4j:include viewId="/search.jspx" id="searchObjectPage_#{panelId}"/>
       </rich:modalPanel>
      </a4j:outputPanel>



      The search.jspx (which is being included after ajax-response) looks like:

      <a4j:region>
       <rich:panel id="searchPanel" bodyClass="searchPanel">
       <!-- Just a test -->
       <h:outputText value="#{searchBean.entries.rowCount}"></h:outputText>
       <rich:dataTable id="searchTable" binding="#{searchBean.datatable}" value="#{searchBean.entries}"
       var="entry" rows="10" rowClasses="oddRow,evenRow">
       <!-- render data -->
       </rich:datatable>
       </rich:panel>
      </a4j:region>



      Workflow: User clicks on the command-button. The actionparam "REQUEST_SEARCHPANEL_INCLUDE" is being set to true. After the request returns, the modal panel (defined in a4j:outputPanel with the id outPanel_#{panelId}) is being rerendered. The method "searchBean.entries.rowCount" (defined in search.jspx) is being called and returns the size of the fetched data, but the "rich:databable" isnt being refreshed although the list contains entries. I'm very confused about this...

      Any ideas? Thanks for your help :)