Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Gesuino Napoli
Example jsf2-export-pdf-portlet - Try to download a UIData Error
22. Dezember 2011 07:23
Antwort

Gesuino Napoli

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 5. Dezember 2011

Neue 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
Neil Griffin
RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error
4. Mai 2012 09:36
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2062

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

You might want to try the PrimeFaces p:dataExporter or ICEfaces ace:dataExporter components.
Gesuino Napoli
RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error
20. Juni 2012 02:00
Antwort

Gesuino Napoli

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 5. Dezember 2011

Neue 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
1writeExcelToResponse(((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.
Neil Griffin
RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error
20. Juni 2012 06:26
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2062

Eintrittsdatum: 26. Juli 2005

Neue 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.
Gesuino Napoli
RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error
20. Juni 2012 15:00
Antwort

Gesuino Napoli

Rang: New Member

Nachrichten: 3

Eintrittsdatum: 5. Dezember 2011

Neue Beiträge

This is a great improvment, thank you Neil for your important work!
Neil Griffin
RE: Example jsf2-export-pdf-portlet - Try to download a UIData Error
20. Juni 2012 15:40
Antwort

Neil Griffin

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 2062

Eintrittsdatum: 26. Juli 2005

Neue Beiträge

My pleasure Gesuino -- Thanks for using Liferay Faces.