2 Replies Latest reply on Apr 3, 2008 11:19 AM by Nagarajan Sivakumar

    RichFaces datascroller for DataTable

    Nagarajan Sivakumar Newbie

      Hello,
      I have been facing a rather peculiar problem with the datascroller in RichFaces - i am new to JSF and i started working on RichFaces a while ago and datascroller was a component that was intially working.

      right now i have a datascroller which i am trying to use for pagination and it has just stopped working like it used to - i dont get any error messages when i try to click on the "next" or "last" buttons - just that nothing really happens. It is almost as though that AJAX calls are not getting generated at all - it just stopped working.

      I am using 3.1.4 GA and deploying to Apache Tomcat 6.0.16. I was also curious if there is any other component in RichFaces that will allow pagination of data table or if i may not have any choice but to write one on my own.

      Thanks in advance for any suggestions and help,
      NS

        • 1. Re: RichFaces datascroller for DataTable
          Ilya Shaikovsky Master

          could you update to 3.2.0?

          B.t.w. in our demo under 3.1.4 datascroller works jsut fine.. So seems we need more info in any way..

          • 2. Re: RichFaces datascroller for DataTable
            Nagarajan Sivakumar Newbie

            Here is the JSP code

            Code begins
            *****************
            <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
            <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

            <%
            String path = request.getContextPath();
            String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
            %>

            <h:form>
            <rich:spacer height="5" />
            <rich:dataTable width="75%" rows="10" id="reportsList"
            columnClasses="col" value="#{reportListBean.reports}" var="result">
            <f:facet name="header">
            <rich:columnGroup>
            <h:column rendered="#{reportListBean.columnStatus['id']}">
            <h:outputText styleClass="headerText" value="Request ID" />
            </h:column>
            <h:column rendered="#{reportListBean.columnStatus['status']}">
            <h:outputText styleClass="headerText" value="Status" />
            </h:column>
            <h:column rendered="#{reportListBean.columnStatus['lastUpdate']}">
            <h:outputText styleClass="headerText" value="LastUpdate" />
            </h:column>
            <h:column rendered="#{reportListBean.columnStatus['createdBy']}">
            <h:outputText styleClass="headerText" value="Created By" />
            </h:column>
            <h:column rendered="#{reportListBean.columnStatus['history']}">
            <h:outputText styleClass="headerText" value="History" />
            </h:column>
            </rich:columnGroup>
            </f:facet>
            <h:column rendered="#{reportListBean.columnStatus['id']}">
            <h:outputText value="#{result.id}" />
            </h:column>

            <h:column rendered="#{reportListBean.columnStatus['lastUpdate']}">
            <h:outputText value="#{result.lastUpdated}" />
            </h:column>
            <h:column rendered="#{reportListBean.columnStatus['createdBy']}">
            <h:outputText value="#{result.displayCreatedByUser}" />
            </h:column>
            <h:column rendered="#{reportListBean.columnStatus['history']}">
            <h:outputText value="show" />
            </h:column>
            </rich:dataTable>
            <rich:spacer height="5" />
            <rich:datascroller align="center" for="reportsList" maxPages="20" />
            </h:form>

            *************Code ends*********

            The records in the table are returned from a call to the backing bean.

            The dataScroller shows the correct number of pages ( since i tried returning 20 records from the backing bean, the scroller shows pages 1 and 2 but once you click on them, nothing happens.)

            The really strange thing is that i have had success with the datascroller before - it was infact working until just a couple of days back.

            I would have to consult with my team lead about switching to 3.2 - its not in my hands.

            Thanks,
            NS