problems with datascroller
numay Jan 24, 2012 4:57 AMhello
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"> <html> <head> <title> .: View Books By Author Name :.</title> </head> <body> <f:view> <f:loadBundle basename="com.simulation.messages" var="message"/> <h1>Books by Author Name</h1> <br> <hr> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:form id="form"> <h:panelGrid columnClasses="acent"> <rich:dataTable value="#{BookBean.listOfBooks}" var="list" id="table" rows="10" style=" width : 245px;" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> <rich:column > <f:facet name="header"> <h:outputText value="select" /> </f:facet> <h:selectBooleanCheckbox value="#{list.selected}" /> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="BookName" /> </f:facet> <h:outputText value="#{list.name}" /> </rich:column> <rich:datascroller for="table" maxPages="4" /> </rich:dataTable> </h:panelGrid> <h:commandButton action="#{BookBean.borrowBook}" value="#{message.button_text}"/> </h:form> </ui:composition> </f:view> </body> </html>
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 ) 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 .