3 Replies Latest reply on Aug 3, 2009 3:21 AM by Ilya Shaikovsky

    ajaxSingle on dataTable does not work?

    Yuhong Zhang Newbie

      I have several dataTables on a page, each on different rich:panelBarItem. Now when the user scrolling on one table, I want only that table/panel to rerender, not the whole page. I cannot get that to work with ajaxSingle="true" on the dataScroller. Everytime a page is changed on any scroller, all the tables rerendered. Any idea what I can do?

      <rich:panelBar >
      <rich:panelBarItem label="Transactions">
      <h:form id="transactionListForm">
      <rich:datascroller id="topScroller" reRender="bottomScroller"
       ajaxSingle="true" for="transactionList"/>
      
      <rich:dataTable id="transactionList" var="transaction" align="center"
       sortMode="single"
       value="#transactionListController.transactionList}"
       onRowMouseOver="this.style.backgroundColor='#DDDDDD'"
       onRowMouseOut="this.style.backgroundColor='#a4jSkin.tableBackgroundColor}'"
       rows="#transactionListController.transactionList.pageSize}">
      
      ......
      
      </rich:dataTable>
      
      <rich:datascroller id="bottomScroller" reRender="topScroller"
       ajaxSingle="true" for="transactionList"/>
      </form>
      </rich:panelBarItem>
      <rich:panelBarItem label="Events">
      
      ...... another dataTable
      
      </rich:panelBarItem>
      </rich:panelBar>
      


        • 1. Re: ajaxSingle on dataTable does not work?
          Alexander Smirnov Master

          Try to append 'limitToList="true" attribute to the datascroller.

          • 2. Re: ajaxSingle on dataTable does not work?
            Yuhong Zhang Newbie

             

            "alexsmirnov" wrote:
            Try to append 'limitToList="true" attribute to the datascroller.


            Thanks a lot for the help! It took that and upgrading to richfaces 3.3.1 GA to be able to rerender just the table that is paging. (I am not sure what rich version that SEAM 2.1.2 GA shipped with. It did not work there!)

            But I have a new problem. I have tow dataScrollers on the top and bottom. They don't rerender each other any more. They are doing fine if not in the panelBar. But they are out of synch in the panelBar.

            • 3. Re: ajaxSingle on dataTable does not work?
              Ilya Shaikovsky Master

               

              <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:a4j="http://richfaces.org/a4j"
               xmlns:rich="http://richfaces.org/rich">
              
               <style>
              .col {
               width: 100px;
              }
              </style>
               <rich:panelBar>
               <rich:panelBarItem label="first">
               <h:form>
               <rich:datascroller align="left" for="carList" maxPages="20" ajaxSingle="true" limitToList="true"
               page="#{dataTableScrollerBean.scrollerPage}" reRender="sc2" id="sc1" />
               <rich:spacer height="30" />
               <rich:dataTable width="483" id="carList" rows="10" columnClasses="col"
               value="#{dataTableScrollerBean.allCars}" var="category">
               <f:facet name="header">
               <rich:columnGroup>
               <h:column>
               <h:outputText styleClass="headerText" value="Make" />
               </h:column>
               <h:column>
               <h:outputText styleClass="headerText" value="Model" />
               </h:column>
               <h:column>
               <h:outputText styleClass="headerText" value="Price" />
               </h:column>
               <h:column>
               <h:outputText styleClass="headerText" value="Mileage" />
               </h:column>
               </rich:columnGroup>
               </f:facet>
              
               <h:column>
               <h:outputText value="#{category.make}" />
               </h:column>
               <h:column>
               <h:outputText value="#{category.model}" />
               </h:column>
               <h:column>
               <h:outputText value="#{category.price}" />
               </h:column>
               <h:column>
               <h:outputText value="#{category.mileage}" />
               </h:column>
              
              
              
               </rich:dataTable>
               <rich:datascroller align="left" for="carList" maxPages="20" ajaxSingle="true" limitToList="true"
               page="#{dataTableScrollerBean.scrollerPage}" id="sc2" reRender="sc1" />
               </h:form>
               </rich:panelBarItem>
               </rich:panelBar>
              
              </ui:composition>
              


              works for me at 3.3.2 snapshot.