PageEvent.getPage() return the preceding selected page index

UI Components for JSF
Post Reply
DMM
Posts: 6
Joined: 02 Mar 2012, 11:22

11 Apr 2012, 11:31

I added the ajax page event in the datatable pagination example:

Code: Select all

<p:dataTable id="dataTable" var="car" value="#{tableBean.cars}"
                     paginator="true" rows="10"
                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                     rowsPerPageTemplate="5,10,15">
            
    <p:ajax event="page" listener="#{tableBean.onPage}"/>
            
    <f:facet name="header">
        Ajax Pagination
     </f:facet>
...
I added the method onPage int the TableBean class:

Code: Select all

public void onPage (PageEvent event){
        log.info("Page Selection :: " + event.getPage());
}
I realize that event.getPage() return the index of the preceding page and not the just clicked page. To me it seems to be a bug. Is there a way to retrieve the page just selected ?

I use Primefaces 3.3-SNAPSHOT.

All the best,

--didier

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

11 Apr 2012, 12:10

Try 3.2, the stable one.

DMM
Posts: 6
Joined: 02 Mar 2012, 11:22

11 Apr 2012, 13:16

I used 3.2 and it works ! Thank you.

--didier

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests