フォーラム

ホーム » Liferay Faces » Liferay Faces - English

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Gesuino Napoli
Example jsf2-export-pdf-portlet - Try to download a UIData Error
2011/12/22 7:23
答え

Gesuino Napoli

ランク: New Member

投稿: 3

参加年月日: 2011/12/05

最近の投稿

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
2012/05/04 9:36
答え

Neil Griffin

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2035

参加年月日: 2005/07/26

最近の投稿

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
2012/06/20 2:00
答え

Gesuino Napoli

ランク: New Member

投稿: 3

参加年月日: 2011/12/05

最近の投稿

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
2012/06/20 6:26
答え

Neil Griffin

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2035

参加年月日: 2005/07/26

最近の投稿

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
2012/06/20 15:00
答え

Gesuino Napoli

ランク: New Member

投稿: 3

参加年月日: 2011/12/05

最近の投稿

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
2012/06/20 15:40
答え

Neil Griffin

LIFERAY STAFF

ランク: Liferay Legend

投稿: 2035

参加年月日: 2005/07/26

最近の投稿

My pleasure Gesuino -- Thanks for using Liferay Faces.