1 Reply Latest reply on Jan 20, 2009 10:41 AM by achildress

    datascroller shows wrong number of pages after rerender

    achildress

      I have a dataGrid with an associated datascroller. I provide the user the option to "process" an item in the dataGrid, thus removing it from the table's data. When I do so, I want to redisplay the dataGrid at the same page the user was on when they "processed" the item, and if the user had been on the last page and had just processed the only item on that page, then I want to redisplay the dataGrid on the previous page. The problem comes when they "process" an item on the last page and that item is the only item on the page. When I remove the item from the data and rerender the dataGrid, the dataGrid is correctly showing the previous page as I want it to, but the datascroller shows an incorrect number of pages. For instance, my dataGrid shows 2 items per page, the user is on page 4, and processes the one item displayed on that page (item 7 in the data). I rerender the dataGrid and it correctly shows the data on page 3 now, but the datascroller shows that there are still 4 pages and also shows that it is currently on page 4.

      I am using the page attribute of datascroller, and I correctly set the backing bean property to page 3 after I refresh the data collection associated with the dataGrid, but for some reason the datascroller does not seem to know that there are now only 6 items in the collection and that it is currently showing page 3.

      Any ideas? This is a deal breaker for my users as far as application functionality.