6 Replies Latest reply on Sep 12, 2008 12:12 PM by tryan702

    rich:datascroller filter problems

    tryan702

      I'm using NetBeans6.1, RichFaces3.2.2, JSF1.2 and JDK1,6. I am having problems when using the datascroller for a datatable to allow multiple pages. When i use the filter it will limit the records in the datatable and the datascroller will only show the pages necessary to fit those records matching the filter but when i remove that filter the datascroller is not rerendering to show all the pages again. Any ideas? Here is the jsp page:

      <rich:dataTable binding="#{Results.hdtResults}" id="hdtResults" var="currentRow" rows="#{Results.rowsPerPage}" />
      <rich:datascroller for="hdtResults" binding="#{Results.hds}" renderIfSinglePage="false" pagesVar="#{Results.numPages}"/>

        • 1. Re: rich:datascroller filter problems
          ilya_shaikovsky

          datascroller should be reRendered also with dataTable when you changing filter in order to be updated according to the dataTable current model

          • 2. Re: rich:datascroller filter problems
            tryan702

            I was able to resolve this by putting the datatable and datascroller inside a rich:panel then having the datascroller reRender the panel. I couldn't figure out how to reRender the datascroller or datatable by changing the filter. How could you do that, the filter is part of the rich:column added to the datatable. Any ideas?

            • 3. Re: rich:datascroller filter problems
              konstantin.mishin

              Use like this:
              <rich:dataTable binding="#{Results.hdtResults}" id="hdtResults" var="currentRow" rows="#{Results.rowsPerPage}" reRender="datascroller"/>
              <rich:datascroller id="datascroller" for="hdtResults" binding="#{Results.hds}" renderIfSinglePage="false" pagesVar="#{Results.numPages}"/>

              • 4. Re: rich:datascroller filter problems
                tryan702

                Thank you for your reply. I have tried setting the reRender on the datatable to reRender the datascroller but that didn't work.

                • 5. Re: rich:datascroller filter problems
                  konstantin.mishin

                  Please post full page code.

                  • 6. Re: rich:datascroller filter problems
                    tryan702

                    When the a4j:region looks like below the datascroller works properly:

                    <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
                    xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
                    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
                    <f:view>
                    <webuijsf:page id="ResultsPage" >
                    <webuijsf:html id="htmlResults" binding="#{Results.html1}">
                    <webuijsf:head id="head1" binding="#{Results.head1}">
                    <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
                    </webuijsf:head>
                    <webuijsf:body id="body1">
                    <webuijsf:form id="form1" styleClass="lightGreyMaintd">
                    <a4j:region>
                    <h:outputText id="theDisplay" value="#{Results.xsltString}" escape="false" />
                    <rich:panel id="Results">
                    <rich:dataTable binding="#{Results.hdtQueryResults}" id="hdtResults" var="currentRow" reRender="hds"/>
                    <rich:datascroller id="hds" for="hdtResults" binding="#{Results.hds}" renderIfSinglePage="false" reRender="Results" pagesVar="#{Results.numPages}"/>
                    </rich:panel>
                    </a4j:region>
                    </webuijsf:form>
                    </webuijsf:body>
                    </webuijsf:html>
                    </webuijsf:page>
                    </f:view>
                    </jsp:root>

                    It does not work when i change a4j:region to this:
                    <a4j:region>
                    <h:outputText id="theDisplay" value="#{Results.xsltString}" escape="false" />
                    <rich:dataTable binding="#{Results.hdtQueryResults}" id="hdtResults" var="currentRow" reRender="hds"/>
                    <rich:datascroller id="hds" for="hdtResults" binding="#{Results.hds}" renderIfSinglePage="false" pagesVar="#{Results.numPages}"/>
                    </a4j:region>