Foren

RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error

thumbnail
Gesuino Napoli, geändert vor 12 Jahren.

Example jsf2-export-pdf-portlet - Try to download a UIData Error

New Member Beiträge: 3 Beitrittsdatum: 05.12.11 Neueste Beiträge
Hi all, i'm be able to configure and run the example jsf2-export-pdf-portlet. But if I want to extend it and try to download an Excel created from an UIData (dataTable) i have many problems.

This is my scenario: i have a jsf page with a dataTable and a button download Excel. When the user clicks download an ExcelService starts, takes from view the dataTable, create the excel and return it to the Client view.

The problem is "takes from view". In the example there is an extension CustomerResourceHandler that manage the Resource but in my case when my Resource (ExcelResource) try to obtain the dataTable a NullPointerException is Throws.

I tried to make UIData a Managed sessionScoped Bean but the same problem is throws when my method try to read some properties from the dataTable. Any Idea how to solve my issue? Tnx Gesuino
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
You might want to try the PrimeFaces p:dataExporter or ICEfaces ace:dataExporter components.
thumbnail
Gesuino Napoli, geändert vor 11 Jahren.

RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error

New Member Beiträge: 3 Beitrittsdatum: 05.12.11 Neueste Beiträge
Thank you Neil but this is not the solution. Primefaces and Icefaces to export the data they use the HttpServetResponse. Like example primefaces export excel in this way
writeExcelToResponse(((HttpServletResponse)context.getExternalContext().getResponse()), wb, filename);

This cause two problems, with liferay we cannot use HttpServletResponse directy and this produce an error, second the response is encapsuled by liferay that return an html and not an excel.
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
A few weeks ago I submitted a patch for this problem to Çağatay. See PrimeFaces Issue#1109.

He indicated that it would be fixed in PrimeFaces 3.4. Until then, you can apply that patch to a local build of PrimeFaces 3.3.1 in order to get things working.
thumbnail
Gesuino Napoli, geändert vor 11 Jahren.

RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error

New Member Beiträge: 3 Beitrittsdatum: 05.12.11 Neueste Beiträge
This is a great improvment, thank you Neil for your important work!
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
My pleasure Gesuino -- Thanks for using Liferay Faces.