You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hasnain Badami <ha...@gmail.com> on 2007/05/18 16:14:16 UTC

Problem while implementing WorkingWithLargeTables

Hi
I am trying to implement WorkingWithLargeTables article present on wiki, on
the search page of my application (search can return hundreds of results).
The user fills in the search criteria and presses the search button.
I have used the DataPage and PagedListDataModel classes. Also I have created
the inner class in my backing bean which extends PagedListDataModel. The in
my jsp page I have got the following code for datatable and datascroller

<t:dataTable
var="searchResult"
value="#{advSearchUI.searchResultsData}"
rows="#{advSearchUI.numberOfRecords}"
rowClasses="standardTableRow1, standardTableRow2"
columnClasses="alignLeft"
align="center"
styleClass="tableWithoutFooter"
id="searchResultsDataTable"
width="100%"
forceId="#{searchResult.id}"
rowId="#{searchResult.id}"
preserveDataModel="false"
renderedIfEmpty="true"
rowIndexVar="rIndex"
>

and

<t:dataScroller for="searchResultsDataTable"
                        pageCountVar="pageCount"
                        pageIndexVar="pageIndex"
                        styleClass="scroller"
                        paginator="#{true}"
                        paginatorMaxPages="1000"
                        paginatorTableClass="paginator"
                        paginatorActiveColumnStyle="font-weight:bold;"
                        immediate="false"
>
On entering the criteria and pressing search the datatable populates with
the first page of the results, and the datascroller shows paging, which is
excellent. But when I click 2nd page link it acts wierdly and throws the
following exception :

*

java.lang.IllegalArgumentException*: Illegal value for first row: -20

at javax.faces.component.UIData.setFirst(*UIData.java:991*)

at org.apache.myfaces.component.*html*.ext.HtmlDataTable.setFirst(*
HtmlDataTable.java:634*)

at org.apache.myfaces.custom.datascroller.HtmlDataScroller.broadcast(*
HtmlDataScroller.java:187*)

at javax.faces.component.UIViewRoot._broadcastForPhase(*UIViewRoot.java:94*)

at javax.faces.component.UIViewRoot.processApplication(*UIViewRoot.java:168*
)

at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(*
LifecycleImpl.java:343*)

at org.apache.myfaces.lifecycle.LifecycleImpl.execute(*LifecycleImpl.java:86
*)

at javax.faces.webapp.FacesServlet.service(*FacesServlet.java:137*)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(*
ApplicationFilterChain.java:252*)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(*
ApplicationFilterChain.java:173*)
Can anybody hint towards the reason and the solution to this problem? I am
using myfaces 1.1.3 and  tomahawk 1.1.3. I shall be highly obliged with any
responses.