2 Replies Latest reply on Feb 12, 2012 1:35 PM by ahoehma

    Select object to show in a datatable from server side

    ahoehma

      hihi,

       

      Is it possible to navigate to a element in a (pagging) datatable?

       

      My crud scenario: user use datatable to view entries ... pagging to page 5 of 10 .... then execute "new entity action" ... after this the table should show the new created element.

       

      I'm using richfaces 3.3.2.GA.

       

      Regards

      Andreas

        • 1. Re: Select object to show in a datatable from server side
          mcmurdosound

          are you using a rich:datascroller? Just give it an id and in your createNewEntry method do the following:

           

          FacesContext ctx = FacesContext.getCurrentInstance();

          UIComponent component = ctx.getViewRoot().findComponent(fullClientIdOfTheDataScroller); // like myform:myDS

           

          I'm not sure what the datascrollers class name is, but you'll have to cast the UIComponent to the datascrollers class and then you'll have some methods to set the page.

           

          Additionally you'll have to rerender both the table and the datascroller.

          1 of 1 people found this helpful
          • 2. Re: Select object to show in a datatable from server side
            ahoehma

            Ok. But how can I find the right page for the new entry?

            Should I use the walk method on the datamodel?