2 Replies Latest reply on Nov 22, 2007 6:45 AM by joachimhb

    Reset pagenumber of datascroller ?

      Hello,

      Using Richfaces 3.0.1, is it possible to reset the pagenumber when you receive an AjaxResponse ? I have a search which populates a rich:dataTable (which again uses a rich:dataScroller). When I perform a search that has 5 pages, navigate to page 3. and then perform another search, I would like the dataScroller to show page 1 of the search results...

      Is this possible with the rich:dataScroller ?

        • 1. Re: Reset pagenumber of datascroller ?
          diegocoronel

          workaround for you:

          String id = "paisSearch:paisList";
          UIComponent comp = FacesContext.getCurrentInstance().getViewRoot().findComponent(id);
          UIData uidata = (UIData) comp;
          uidata.setFirst(0);
          


          use this in your action, if you got a better solution, pls i wanna know :)

          • 2. Re: Reset pagenumber of datascroller ?

            Thank you, this works, allthough I added a NullPointerException. I would rather there be a more simple solution, as the ID of the component changes based on the components that it is inside (say if you add a panel or something in a higher nesting).

            I'll be sure to post back if I find a better solution!

            "DiegoCoronel" wrote:
            workaround for you:

            String id = "paisSearch:paisList";
            UIComponent comp = FacesContext.getCurrentInstance().getViewRoot().findComponent(id);
            UIData uidata = (UIData) comp;
            uidata.setFirst(0);
            


            use this in your action, if you got a better solution, pls i wanna know :)