6 Replies Latest reply on Oct 10, 2007 1:02 AM by bfayle

    rich:dataScroller doubt

    daedlus

      hi
      i have 2 questions
      1.i have a table with check box in 1 column.when i navigate to page2 in datatable using rich scroller the checkboxes state is lost on page 1, how do i prevent this.

      2.now suppose iam in page 2 of datatable , i navigate to some other new xhtmlpage (view)and comback i see the scroller is still still showing page 2.i want it to show page 1 when ever i return to this xhtml page.

      help appreciated.

        • 1. Re: rich:dataScroller doubt
          ilya_shaikovsky

          1) AjaxSingle="false" on dataScroller.

          2) Did you perform return with browser button?

          • 2. Re: rich:dataScroller doubt
            daedlus

            thx for the reply,
            i navigate to some other xhtml file using face-navigation and then again comeback to current xhtml the scroller state remains as before

            • 3. Re: rich:dataScroller doubt
              ilya_shaikovsky

              And this isn't true for me.

              1) What is your bean scope?
              2) Paste code snippets.
              3) What is your RF version.

              • 4. Re: rich:dataScroller doubt
                daedlus

                1. session scope

                3. 3.1.0 GAversion

                2.code below:

                <table width="100%" border="0">
                 <tr>
                 <td valign="top"><rich:datascroller for="id_table"
                 maxPages="10" width="100%" /> <rich:dataTable
                 id="id_table" rows="4"
                 value="#{myBean.list}"
                 binding="#{myBean.dataTable}"
                 var="record" rowClasses="rowOdd, rowEven">
                 <f:facet name="header">
                 <rich:columnGroup>
                 <rich:column>
                 <h:outputText value="Id" />
                 </rich:column>
                 <rich:column>
                 <h:outputText value="name" />
                 </rich:column>
                 <rich:column>
                 <h:outputText value="remove" />
                 </rich:column>
                 </rich:columnGroup>
                 </f:facet>
                 <rich:columnGroup>
                 <rich:column>
                 <h:outputText value="#{record.id}" />
                 </rich:column>
                 <rich:column>
                 <h:outputText value="#{record.name}" />
                 </rich:column>
                
                 <rich:column>
                 <h:commandButton value="remove"
                 image="images/remove.gif"
                 immediate="true"
                 action="#{myBean.removeFromlist}"/>
                 </rich:column>
                 </rich:columnGroup>
                 </rich:dataTable></td>
                 </tr>
                 </table>
                
                

                say page 2 has one row , when i press remove in that row , the row is removed . the scroller still shows page 2 (with no rows) instead of page 1.

                • 5. Re: rich:dataScroller doubt
                  ilya_shaikovsky

                  http://jira.jboss.com/jira/browse/RF-1048. Yes that improvement was done some times ago.. but seems it's broken..

                  • 6. Re: rich:dataScroller doubt
                    bfayle

                    I was able to work around this issue using the following code:

                    mylist.remove(rowIndex);
                    if (rowIndex == mylist.size()) {
                     rowIndex--;
                    }
                    int currentPage = rowIndex / rows + 1;
                    datascroller.setPage("" + currentPage);
                    


                    where datascroller is a binding to the datascroller component