0 Replies Latest reply on Apr 28, 2011 12:24 AM by Bernhard Hurzeler

    How to reset the Page in DataScroller when ExtendedDatatable gets sorted

    Bernhard Hurzeler Novice

      Hi there,

      I got a quick question. This issue has been widely discussed already but I have a small variation to the theme. Hence please forgive me for bringing this up again.

       

      My datascroller does not reset to page #1 after the ExtendedDatatable gets sorted. The obvious answer is to use a backing bean to set the page on the datascroller.

      <rich:datascroller for="dataTable" page="#{bean.page}" />

      This is all great but where do I best set the page on my bean. I know that on a ExtendedDataModel that implements Modifiable the method modify gets called when the sort is clicked in the header of the table. Hence I could set the page there. The problem with this is that the modify method gets also called when the page is changed via the datascroller.

       

      Do you have any suggestion on how to set the page properly when the sort in the header is clicked. Is there a particular event raised I could listen to or fire the method by using an ajax event. But which one?

       

      Please help! Thanks.