Setting page index of DataTable not working in 3.0

UI Components for JSF
Post Reply
leon.guan
Posts: 15
Joined: 28 Apr 2010, 05:59

26 Jun 2011, 19:13

A while back we have a new feature get implemented in 3.0 which is about bring page index as a post back parameter, it means we can use session scope variable to store data table in backbean with pagination stored as well.

Somehow, it just turned out, the fix worked fine, I can see the page index was the number stored in session, but the problem is data of datatable showed is not right, it's actually first page at all cases.

I used showcase app to make a try, with this page:

http://www.primefaces.org/showcase-labs ... nation.jsf

And I put "page=2" in dataTable properties, then open that page, and I found out we have page index showed on page 2, but the data is same as page one.

leon.guan
Posts: 15
Joined: 28 Apr 2010, 05:59

29 Jun 2011, 08:48

Bump up..... :(

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

29 Jun 2011, 08:59

You are right, I have replicated that, does it happen with 3.0.M1 as well?

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

29 Jun 2011, 09:01

I think you also need to define the first attribute like first="10" as well.

leon.guan
Posts: 15
Joined: 28 Apr 2010, 05:59

30 Jun 2011, 08:23

yes, it happened to 3.0M1 and then I tried M2, the problem persisted.

I will try the first property tonite and will keep you updated. Thanks.

UPDATED:

Thanks a lot, I added a new property in backbean for "first" property of the datatable to store the start row position, apparently it will be updated at each postback and it did it's job. I think we are good now, but have to make sure we will need three properties to be stored at backbean if we need current page position be restored:

- page
- first
- rowPerPage
Last edited by leon.guan on 30 Jun 2011, 18:41, edited 1 time in total.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 58 guests