user3516948
user3516948

Reputation: 13

Prime faces Export data not working

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

Answers (2)

Hakan Anlamaz
Hakan Anlamaz

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

LarsBauer
LarsBauer

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

Related Questions