7 Replies Latest reply on Aug 23, 2007 8:19 AM by mpulse

    Datascroller "reRender"

    mpulse

      Hello

      I'm using a datascroller with a table and I'd like to know if it's possible to reRender the datascroller so I want to have focus on the first page when I reRender the table

      ex:

      -we have 5 pages on the datascroller and the focus is on the fifth
      -we rerender the table (reRender the panel which contains the table and datascroller)
      -the table have now just 4 pages but the datascroller is always on the fifth and we saw nothing in the table, we must click on last button on the datascroller to see something.

      any ideas?

      thanks

        • 1. Re: Datascroller
          ilya_shaikovsky

          Wha is your RF version?

          • 2. Re: Datascroller
            mpulse

            Sorry RF version is 3.0.1

            • 3. Re: Datascroller
              mpulse

              i'd like to add something when we reRender the table and table have just 4 pages is normal because it's for filtered the table the problem is the focus on the page's number on the datascroller stay on its last position .

              • 4. Re: Datascroller
                ilya_shaikovsky

                please update to 3.1.0 GA. The bugs very similar to your case was fixed till 3.0.1 release.

                • 5. Re: Datascroller
                  kewldude

                  Im not sure if this is the same issue that I've encountered with the scroller, but my workaround is by calling

                  table.setFirst(0);//sets the scroller to 1st page

                  where table is declared as:
                  UIData table

                  and you have to have a binding of your table in order to call the setFirst method.

                  • 6. Re: Datascroller
                    mpulse

                    the code is :


                    for the datatable

                    <rich:panel id="listmessage">
                     <f:facet name="header">Listes des messages</f:facet>
                    
                     <f:view>
                     <h:form>
                     <h:outputText value="No messages to display" rendered="#{messageList.rowCount==0}"/>
                     <rich:datascroller stepControls="auto" id="datascroller" for="msgList" maxPages="20"/>
                     <rich:spacer height="15"/>
                    
                     <rich:dataTable id="msgList" rows="2" var="msg" value="#{messageList}"
                     rendered="#{messageList.rowCount>0}"
                     onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                     onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                     cellpadding="0" cellspacing="0">



                    code wich reRender the panel

                    
                    <rich:toolBarGroup location="right">
                     <h:form id="searchAll">
                     <h:inputText styleClass="barsearch" id="searchAlltext" value="#{search.all}"/>
                     <a4j:commandButton refresh="listmessage,datascroller"
                    action="#{messageManager.SearchByAll(search.all)}"
                    reRender="listmessage,datascroller" value="Search" styleClass="configButton" />
                     </h:form>
                     </rich:toolBarGroup>


                    • 7. Re: Datascroller
                      mpulse

                      no idea ? I don't understand how use

                      >> table.setFirst(0);//sets the scroller to 1st page <<