6 Replies Latest reply on Feb 7, 2008 10:24 AM by Vivek Rautela

    Pagination problem

    Vivek Rautela Newbie

      Hi All,
      I am writing code for pagination, when i try to call a method with a parameter the value of that parameter is always 0 in the bean. But when I hard code the value it takes the hardcoded value.

      My Code:-

      <h:panelGrid columns="10">
       <c:forEach items="#{userManage.pageLinks}" var="link">
       <s:link action="#{userManage.loadSelectedPage(link)}" value="#{link}">
       </s:link>
       </c:forEach>
      </h:panelGrid>
      


      pageLinks is a collection of Integer.

      When I hard code the value:-

      <h:panelGrid columns="10">
       <c:forEach items="#{userManage.pageLinks}" var="link">
       <s:link action="#{userManage.loadSelectedPage('1')}" value="#{link}">
       </s:link>
       </c:forEach>
      </h:panelGrid>
      


      Session bean-
      public void loadSelectedPage(int requestedPage) {
       this.requestedPage = requestedPage;
       log.info("Requested page number = " + this.requestedPage); // always gives 0
       fetchUsersDetails();
       }
      


      Am I doing something wrong in here?

      Thanks in advance.

      -Vivek