-
1. Re: <rich:datascroller>: Reset of page index after re-render
sri_hari May 6, 2008 1:17 AM (in response to ma.aqcon)set the first attribute of the data table to 0
-
2. Re: <rich:datascroller>: Reset of page index after re-render
ma.aqcon May 6, 2008 3:05 AM (in response to ma.aqcon)Thanks for your response.
I did a quick test without success but I will do some further investigation ... -
3. Re: <rich:datascroller>: Reset of page index after re-render
daniel.soneira May 6, 2008 4:26 AM (in response to ma.aqcon)First - bind your datascroller into the backing bean.
JSP:<rich:datascroller binding="${BackingBean.datascroller}"/>
Then - in your search action you can invoke the method resetDatascroller described below.
Here is the Backing bean:private UIDatascroller datascroller; public UIDatascroller getDatascroller() { return datascroller; } public void setDatascroller(UIDatascroller datascroller) { this.datascroller = datascroller; } private void resetDatascroller() { logger.debug("resetDatascroller"); if (datascroller != null) { datascroller.setPage(UIDatascroller.FIRST_FACET_NAME); } }
If one of the developers happens to read this - I don't know if this has been changed in 3.2.0 (I work with 3.1.5) - but could you please put a similar code snippet into the developer documentation for the datascroller. I guess this is a very common issue that almost everyone using a datascroller encounters very quickly. -
4. Re: <rich:datascroller>: Reset of page index after re-render
ma.aqcon May 6, 2008 4:43 AM (in response to ma.aqcon)Thanks, Daniel! Your solution works fine for me!
I have only two minor additions.
JSP should be<rich:datascroller binding="#{BackingBean.datascroller}"/>
This version of setPage is deprecated (probably in 3.2.0):datascroller.setPage(UIDatascroller.FIRST_FACET_NAME);
And is replaced by a version with an integer argument:datascroller.setPage(1);
-
5. Re: <rich:datascroller>: Reset of page index after re-render
ma.aqcon Jun 5, 2008 3:57 AM (in response to ma.aqcon)This does not work with the latest 3.2.1GA anymore :-(
-
6. Re: <rich:datascroller>: Reset of page index after re-rendering
mchisty Jul 21, 2011 11:11 PM (in response to ma.aqcon)This is a weird behaviour of RichFaces. However the following solution also works (you don't even have to bind with UIDatascroller)
Here is the java code snippet: WorkflowMaintain.java
private int page;
public int getPage() { return page; }
public void setPage(int page) { this.page = page; }
public void someActionMethod() { this.page=1; }
In page: mypage.xhtml
<rich:datascroller
for="workflow_item_datatable"
id="search_result_ds"
page="#{workflowMaintain.page}" />
When re-rendering and calling the action method (someActionMethod), you just set the page variable to 1.
Thanks,
.. Chisty