0 Replies Latest reply on Nov 21, 2007 5:06 PM by raphael.martins

    Bug: rich:dataScroller and Rerender.

      Hi,
      I get a problem when I try to rerender the rich:DataScroller and the rich:DataTAble. The DataScroller component only rerenders in the second request.

      The code below is a simplification of my problem. (only relevant code)

      JSP code

      <h:form id="myTestForm">
       <h:inputText value="#{test.searchContent}" />
       <br />
       <h:commandButton value="Search" action="#{test.search}">
       <a4j:support event="onclick" reRender="myRichDataTable1,myDataScroller1" />
       </h:commandButton>
       <br />
       <a4j:outputPanel ajaxRendered="true" id="myAjaxOutputPanel1">
       <rich:datascroller ajaxSingle="false" id="myDataScroller1" for="myRichDataTable1" immediate="true" />
       <rich:dataTable rows="10" id="myRichDataTable1" var="myLocalList" value="#{test.listNames}">
       <f:facet name="header">
       <rich:columnGroup id="candidateLocalColumnGroup1">
       <rich:column>
       <h:outputText value="Name" />
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:column>
       <h:outputText value="#{myLocalList.name}" />
       </rich:column>
       </rich:dataTable>
       </a4j:outputPanel>
      </h:form>


      ManagedBean code
      public List getListNames()
       {
       Collection myTestList = new ArrayList();
       if (searchContent != null)
       {
       if ( searchContent.equals( "a" ) )
       {
       for ( int i = 0; i < 5; i++ )
       {
       TestDTO testDTO = new TestDTO();
       testDTO.setName( "a" + i );
       myTestList.add( testDTO );
       }
       } else if ( searchContent.equals( "b" ) )
       {
       for ( int i = 0; i < 15; i++ )
       {
       TestDTO testDTO = new TestDTO();
       testDTO.setName( "b" + i );
       myTestList.add( testDTO );
       }
       } else if ( searchContent.equals( "c" ) )
       {
       for ( int i = 0; i < 25; i++ )
       {
       TestDTO testDTO = new TestDTO();
       testDTO.setName( "c" + i );
       myTestList.add( testDTO );
       }
       } else
       {
       myTestList = null;
       }
       }
       return (List) myTestList;
       }
      
       public String search()
       {
       //some validations
       getListNames();
       //workarround to set DataTable page = 1
       return null;
       }