Reputation: 13
I tried to export the data from my datatable but when I press the pdf button for example it refresh the page without export
<h:commandLink >
<p:graphicImage value="/images/excel.png" />
<p:dataExporter type="xls" target="dataTable" fileName="alarms" />
</h:commandLink>
<h:commandLink >
<p:graphicImage value="/images/pdf.png" />
<p:dataExporter type="pdf" target="dataTable" fileName="alarms"/>
</h:commandLink>
<h:commandLink >
<p:graphicImage value="/images/csv.png" />
<p:dataExporter type="csv" target="dataTable" fileName="alarms" />
</h:commandLink>
Upvotes: 0
Views: 1312
Reputation: 61
<h:commandLink style=" text-align: right!important;"
immediate="true" id="excelLinkId" ajax="false" >
<p:dataExporter type="xls" target="myTable" fileName="myExcel" />
</h:commandLink>
Upvotes: 0
Reputation: 1535
<p:commandLink>
has to be surrounded by <h:form>
tag to work.
If this is not the problem can you please provide the source code of your whole page and the PrimeFaces version you are working with?
Upvotes: 0