3 Replies Latest reply on Jan 22, 2008 7:05 AM by Tomislav Tkal?evi?

    Datascroller and last page!?

    Tomislav Tkal?evi? Novice

      Hy to all!
      I have a link,which needs to call a action.
      This action needs to add something to datatable and set datatable to the last page.

      1)Link looks like this:

      This one calls an action which is defined in the pageflow and it works

      <t:commandLink value="Add" action="addAndGoToLast" />
      

      This one points directly to method in a bean and works fine
      <t:commandLink value="Add" action="#{binding.lastPageScroller(scroller)}" />
      


      2)Bean looks like this:

      @Name("binding")
      @Scope(ScopeType.CONVERSATION)
      public class Binding implements Serializable {
      
       @In(required = false, create = true)
       @Out(required = false)
       private UIDatascroller scroller;
      
       public String lastPageScroller(UIDatascroller scroller){
       scroller.setPage(HtmlDataScroller.FACET_LAST);
       return "OK";
       }
      }
      


      3)Scroller is binded through jsp page like this

      <r:datascroller binding="#{scroller}"
       for="table" maxPages="20" renderIfSinglePage="false" />
      


      To simplify the explanation of the problem:
      I need to call multiple actions from pageflow which add's some data to the datatable and set that same datatable to the last page.
      The problem is that if i call directly a method which does all the work then set the datatable to last page it works,but if want to link action from pageflow and do that work through a pageflow it doesnt work,i mean datatable isn't set to the last page,but other action is done without any exceptions.

      So is this the right way to set the datatable to the last page after some action or not?
      I need a solution,please.