Problem with datatable page

UI Components for JSF
Post Reply
jonathandb
Posts: 7
Joined: 13 Apr 2010, 17:18

28 Apr 2010, 17:42

I want to change dataTable content with p:commandLink. To avoid being on a page number that is bigger then the actual page I always want to set the page to 1. I partially solved this with this code:

Code: Select all

<p:commandLink value="filter" action="#{controller.renewDataModel}" onclick="myDataTable.get('paginator').setPage(1,false);" update="dataTablePanel"/>

<h:panelGrid id="dataTablePanel">
  <p:dataTable widgetVar="myDataTable" ... >
     .....
  </p:dataTable>
</h:panelGrid>
But when I'm on page 100 in my datatable, and I filter so I only have one page it sometimes says "No records found". When I filter back to the datasource with 100 pages, i'm back at page 100 for a millisecond. So I guess the onclick="myDataTable.get('paginator').setPage(1,false);" isn't allways executed.

Does someone know a solution?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests