user358448
user358448

Reputation: 1187

How to export data with lazy loading page table in PrimeFaces?

I have <p:dataTable lazy="true" ... /> and I want to be able to export the current page with <p:dataExporter .. />. If my my total rows count is 12 and my page size is 10, I have two pages. The first page has 10 rows, the second page - 1 row. When I click export and I am on the first page I get 11 rows exported in excel (the first row is duplicated on first and last position). Also if I go to the second page, where I have only 1 row and click export the excel contains 1 row on first position, 9 empty lines and the same row on position 11. Which is very odd.

Upvotes: 0

Views: 3050

Answers (2)

Cagatay Civici
Cagatay Civici

Reputation: 6504

You need version 3.0.M4 to do this.

Upvotes: 1

spauny
spauny

Reputation: 5096

What Primefaces Version do you use?

It works fine on lab-showcase: http://www.primefaces.org/showcase-labs/ui/exporter.jsf

Have you tried exporting all data(instead of page data) to see what happens? Also try the page export in CSV or even PDF.

Upvotes: 0

Related Questions