Foren

Primefaces Extensions Exporter Tag on 6.2

thumbnail
William Gosse, geändert vor 9 Jahren.

Primefaces Extensions Exporter Tag on 6.2

Liferay Master Beiträge: 533 Beitrittsdatum: 04.07.10 Neueste Beiträge
Recently I tried using the Primefaces Extensions Exporter tag instead of the standard Primefaces dataExporter. The reason for the change is because the Exporter tag has support for subTables and dataLists which the dataExporter does not. At first its seemed to work then I began getting unsupported content type exceptions from Liferay 6.2. The Exporter only supports xlsx and pdf content types, not xls or csv. I'm not sure what I changed or if I was seeing things the first time I got it to work but for the life of me I can't get it to work again.

Any help will be greatly appreciated.
thumbnail
Kyle Joseph Stiemann, geändert vor 9 Jahren.

Moved.

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Moved to Home » Liferay Faces » Liferay Faces - English
thumbnail
Kyle Joseph Stiemann, geändert vor 9 Jahren.

RE: Primefaces Extensions Exporter Tag on 6.2 (Antwort)

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Hi William,
Liferay Faces does not officially support Primefaces Extensions, but I tested a few and they seemed to work fine in Liferay. However, a component like pe:exporter won't work because it requires either a rewrite to become portlet compatible or additional code in the Liferay Faces bridge accommodate it specifically as an export/download component. I've created an issue to do the latter (FACES-2185), but until this is fixed, I have a simple workaround you can use. First apply the appropriate version of the patch for FACES-1513. Next add a hidden p:commandButton with a p:dataExporter to your h:form that contains your pe:exporter. Your code should probably look something like this:

<h:form>
<!-- your code here ... -->
<p:commandButton ajax="false" value="Export Excel SpreadSheet">
<pe:exporter fileName="table" target="table" type="xlsx" />
</p:commandButton>
<p:commandButton ajax="false" rendered="false" style="display: none;">
<p:dataExporter fileName="workaround" target="uploadedFilesTable" type="csv" />
</p:commandButton>
<p:dataTable id="table" ...>
<!-- your code here -->
</p:dataTable>
</h:form>


After that, the pe:exporter should work as desired (I tested this code with the primefaces5-portlet).

- Kyle
thumbnail
William Gosse, geändert vor 9 Jahren.

RE: Primefaces Extensions Exporter Tag on 6.2

Liferay Master Beiträge: 533 Beitrittsdatum: 04.07.10 Neueste Beiträge
Thanks Kyle! I already have the patch so this looks like an easy fix.
thumbnail
Kyle Joseph Stiemann, geändert vor 9 Jahren.

RE: Primefaces Extensions Exporter Tag on 6.2

Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Glad I could help! Thanks for using Liferay Faces!

- Kyle