-
1. Re: Datascroller + Datatable + Paging + Filtering
kjohnston May 10, 2008 12:31 PM (in response to kjohnston)It is worse than I thought. It appears that when clicking on the data scroller control, the form fields in the containing form are not being bound at all to the backing bean. So the search text never gets set on the bean.
-
2. Re: Datascroller + Datatable + Paging + Filtering
kjohnston May 10, 2008 10:36 PM (in response to kjohnston)OK, I finally got things working again. Posting my discoveries here to help anyone else upgrading from an older version to 3.1.4 (I tried 3.1.5 - same issues).
First some background. We are using a very simple data model - we subclass the javax.faces.model.DataModel. We do not cache any data in the session - we fetch the current page each time the model is invoked.
It looks like the datascroller, when you change pages, no longer processes the other values in the form that it is included in - which included our search field. I worked around this by adding an a4j:actionparam inside the datascroller, and rebinding the search field.
The next problem I hit was that that getRowCount was being called earlier than it was before in the JSF lifecycle, before our search field value was bound to the backing bean. The call to getRowCount caused our data model to load a page - but it was not the page from the correctly filtered set. I noticed that the getRowCount was called in the APPLY_REQUEST_VALUES and PROCESS_VALIDATIONS phases. Since our table doesn't have any editable components in it, I figured it was safe to avoid scanning the table in those phases. So I added in a PhaseTracker and now I simply return 0 in getRowCount during those two phases. -
3. Re: Datascroller + Datatable + Paging + Filtering
lucab May 11, 2008 6:34 AM (in response to kjohnston)i have a problem with datascroller too. i have an inputText for search queries on top of a dataTable. Let's suppose user makes a query that produces more than one page results. Now let's suppose user move on page 2 to read the results. Now our user is satisfied and wants to make another query. Let's say this query is more precise and gives all the results in one page.What happens at this point is that datascroller is still positioned on the second page (from previous query) that now doesn't exist.
How can i force the datascroller to reset on page 1 after every new query? using page attribute does not work. datascroller, after reRendering, will be placed on the last seen page, even if the page, after refresh, does not exist anymore. So, if we stick to my example the user will be presented an empty page with no results and no page numbers displayed by the datascroller. Pushing the fast back button will send user to the first (and only) page where he can see the results of his query. So, how to avoid the 'virtual' second page to show up?
Is it a problem of reRendering or dataScroller is not supposed to work in a continously rerendered table? or i missed something? -
4. Re: Datascroller + Datatable + Paging + Filtering
kjohnston May 11, 2008 10:12 PM (in response to kjohnston)What you can do is define an a4j:commandButton "search" with an action. Declare the scroller inside a managedbean.
Bind your datascroller to the backing bean using the "binding" attribute of the datascroller.
Then, inside the action for the search button, you can call scroller.setPage("1") to return the scroller to the first page. -
5. Re: Datascroller + Datatable + Paging + Filtering
lucab May 12, 2008 8:57 AM (in response to kjohnston)that didn't work...:( datascroller does not update itself corretly. even with binding. a bug?
-
6. Re: Datascroller + Datatable + Paging + Filtering
ilya_shaikovsky May 12, 2008 9:06 AM (in response to kjohnston)we already know about sorting and filtering together with padding problems.
http://jira.jboss.com/jira/browse/RF-2815
just vote and please be patient. -
7. Re: Datascroller + Datatable + Paging + Filtering
kjohnston May 12, 2008 1:52 PM (in response to kjohnston)Are you re-rendering the datascroller? What version are you on?
-
8. Re: Datascroller + Datatable + Paging + Filtering
lucab May 13, 2008 3:52 AM (in response to kjohnston)i'm rerendering the entire datatable to which the datascroller is attached (datascroller is included in a facet:header). Should i rerender explicitly datascroller too?
-
9. Re: Datascroller + Datatable + Paging + Filtering
lucab May 13, 2008 3:53 AM (in response to kjohnston)sorry for the double post but there's no edit button and in the previuos post i forget to say which version of rich faces i'm using: 3.2.0 GA
-
10. Re: Datascroller + Datatable + Paging + Filtering
kjohnston May 13, 2008 1:03 PM (in response to kjohnston)Interesting - our datascroller is not inside the table - it is outside, so yes we are explicity re-rendering. Perhaps that is why it still works for us.
-
11. Re: Datascroller + Datatable + Paging + Filtering
kjohnston May 13, 2008 5:59 PM (in response to kjohnston)Update! To maintain the same behavior in the datascroller, all you have to do is add ajaxSingle=false to the datascroller.
See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103996