-
1. Re: Reset datascroller to page one?
panky_p Jun 18, 2009 7:17 AM (in response to rua)On hitting new search do you reRender the datascroller?
-
2. Re: Reset datascroller to page one?
tomba Jun 18, 2009 8:28 AM (in response to rua)Is that with a page refresh or an ajax request?
It's interesting to see that my pager stays on the same page, even when doing a new page request. Upon that request, I make some logging:14:14:03,968 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:82 - beforePhase(APPLY_REQUEST_VALUES 2) 14:14:03,968 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:84 - Start of repeater: 100 14:14:03,968 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:85 - Pager position: 5 14:14:03,968 WARN be.sofico.web.frmwrk.SiteConfig:96 - Config property enable_policy not found 14:14:03,968 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:82 - beforePhase(PROCESS_VALIDATIONS 3) 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:84 - Start of repeater: 100 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:85 - Pager position: 5 14:14:03,984 WARN be.sofico.web.frmwrk.SiteConfig:96 - Config property enable_policy not found 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:82 - beforePhase(UPDATE_MODEL_VALUES 4) 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:84 - Start of repeater: 100 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:85 - Pager position: 5 14:14:03,984 WARN be.sofico.web.frmwrk.SiteConfig:96 - Config property enable_policy not found 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:82 - beforePhase(INVOKE_APPLICATION 5) 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:84 - Start of repeater: 100 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:85 - Pager position: 5 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:264 - Reset pager to first page 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:266 - Start of repeater: 0 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:267 - Pager position: 5 14:14:03,984 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:154 - loadItems() 14:14:04,906 WARN be.sofico.web.frmwrk.SiteConfig:96 - Config property enable_policy not found 14:14:04,953 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:82 - beforePhase(RENDER_RESPONSE 6) 14:14:04,953 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:84 - Start of repeater: 0 14:14:04,953 DEBUG be.sofico.web.mgbean.report.MasterDataDetail:85 - Pager position: 5
So it was on page 5, I do a new search, and the pager of the results is still on page 5, even though the displayed results are of page 1 of my new search...
ps: Resetting the pager as you can see in the log is done by:cmpTable.setFirst(0); cmpDataScroller.setPage(1);
-
3. Re: Reset datascroller to page one?
rua Jun 18, 2009 8:51 AM (in response to rua)Thanks Tomba. That was exactly the behaviour I had trouble with. The search uses a page refresh.
cmpTable.setFirst(0); cmpDataScroller.setPage(1);
This helps! Thanks a lot! I did only setPage(1) but forgot setFirst(0) on the datatable. -
4. Re: Reset datascroller to page one?
rua Jun 22, 2009 5:19 AM (in response to rua)I had rejoiced too soon. Tomba your solution works but it sets the datascroller to the last page not the first.
Let me explain the behaviour.
Lets say after a search there are 10 possible pages each having n rows. If I click on page 7 and then search again and the search yields equal or less than n results, only one page is displayed and the datascroller is not displayed at all. This is fine. This is what I was looking for.
However if my result yields 6 pages. Then the datascroller and the datatable display the last page. In my logs I find messages like this one:The requested page #26 isn't found in the model containing 2 pages. Paging is reset to page #2
-
5. Re: Reset datascroller to page one?
ilya_shaikovsky Jun 22, 2009 5:38 AM (in response to rua)you could just use page attribute bound to some bean property and reset it when needed. So you will not use component binding at all.
-
6. Re: Reset datascroller to page one?
rua Jun 22, 2009 5:51 AM (in response to rua)Hi Ilya,
could you elaborate on this?
If I use the page attribute I get the initial behaviour. Calling the setter in my actionListener to 1 doesn't seem to have an effect at all. Its just ignored. -
7. Re: Reset datascroller to page one?
ilya_shaikovsky Jun 22, 2009 5:57 AM (in response to rua)which RF version used? Try this at 3.3.1