2 Replies Latest reply on Jan 22, 2012 4:00 AM by numay

    problems with datascroller




      i am newbie in jsf ...


      and while i am practicing with rich faces components i faced a small problem with ( dataScroller)


      the problem is i am using a data table of books  the first column contains checkboxes and the second column has books names


      and it allows user to select from the displayed books


      here is my jsf code:





      <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
      <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
      <%@ taglib prefix="rich" uri="http://richfaces.org/rich" %>
      <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
                          <title> .: View Books By Author Name :.</title>
                                    <f:loadBundle basename="com.simulation.messages" var="message"/>
                                              <h1>Books by Author Name</h1>
                          <ui:composition xmlns="http://www.w3.org/1999/xhtml" 
                                        <h:form id="form">
                                            <h:panelGrid columnClasses="acent">                                       
                                                <rich:dataTable value="#{BookBean.listOfBooks}"   var="list"   id="table"   rows="10"   style="   width : 245px;"
                                                    <rich:column >
                                                        <f:facet name="header">
                                                            <h:outputText value="select" />
                                                        <h:selectBooleanCheckbox value="#{list.selected}"  />
                                                        <f:facet name="header">
                                                            <h:outputText value="BookName" />
                                                        <h:outputText value="#{list.name}" />
                                                             <rich:datascroller for="table" maxPages="4" />
                                              <h:commandButton  action="#{BookBean.borrowBook}" value="#{message.button_text}"/>


      the list in datatable value :


      <rich:dataTable value="#{BookBean.listOfBooks}"


      is list of objects , this object include ... id (int) name (String) selected(boolean)



      so i have two problems with my datatable & datascrolle


      - first problem when i try to get data from the database ( about 80000+ record Description: https://community.jboss.org/4.5.6/images/emoticons/happy.gif )  the datascroller takes about 27 seconds to go from one page to an other  ( i do not know why !!)


      - my second problem is when i check boxes in first page then move to the second page ... after that when i come back to the first page i do not see any boxes selected


      and i did some search about this problem...


      some answers were about inserting ( execute="@form"  or execute="table id") and when i do that , it shows me an error :


      Attribute execute invalid for tag datascroller according to TLD


      i am using 


      rich faces 3.3


      jboss 4.2.2


      and jsf 1.2


      thank you in advance .

        • 1. Re: problems with datascroller

          No: "execute="@form"  or execute="table id"" is for JSF 2 and later only!


          You should try something like this:


          <h:selectBooleanCheckbox value="#{list.selected}" >

          <a4j:support event="onchange" />




          An for your performance problems: you should use a server side pagination, but this is a bit more complicatet than using the buildin clientside pagination of the datascroller.

          • 2. Re: problems with datascroller

            many thanks Christian


            i inserted  the a4j tag .. and it is working now


            and i am gonna read about server side pagination


            many many thanks to you