This content has been marked as final.
Show 2 replies
-
1. Re: how to set current page index in datascroller
tamerg Feb 21, 2008 9:16 AM (in response to piotrwierzbowski)Hi,
You can do this from 2 way.
First, you can use Jsf binding.
Second, you can manipulate the first attribute of datatable.
in this example datascroller always start from last page<rich:dataTable value="#{mybean.list}" var="var" id="testTable" rows="#{mybean.ROW_COUNT_OF_PAGING}" first="#{mybean.firsRowNumberOfDataTable}">
in the bean
private Integer ROW_COUNT_OF_PAGING=20; private Integer firsRowNumberOfDataTable; public void reRenderDataTable(){ firsRowNumberOfDataTable=list.size() % ROW_COUNT_OF_PAGING==0 ?(list.size()<ROW_COUNT_OF_PAGING ? 0 :list.size()-ROW_COUNT_OF_PAGING):list.size()-(list.size() %ROW_COUNT_OF_PAGING); } public Integer getFirsRowNumberOfDataTable() { reRenderDataTable(); return firsRowNumberOfDataTable; } public Integer getROW_COUNT_OF_PAGING() { return ROW_COUNT_OF_PAGING; }
-
2. Re: how to set current page index in datascroller
quintenjiang Feb 22, 2008 10:36 AM (in response to piotrwierzbowski)I also try this function, But it can noly fix to page "2", whatever value you set on first. Is it Bugs?
Thanks
Q