I have a <p:dataTable>
with the multiple selection checkbox. I want to export only some rows to my pdf. Right now when I try to export based on the selected rows it gives me only the rows from the top. For example if I have 10 rows in my datatable and I select 1,4,7,9 to be exported to my PDF. I always get rows 1,2,3,4 in my pdf. I am using the PrimeFaces 5.1 jar. I tried it with 5.2 jar also, Still same issue.
<p:dataTable id="dataall"
var="cars"
value="#{carsEntry.carssUser}"
rows="10"
rowIndexVar="rowId"
paginator="true"
rowKey="#{cars}"
paginatorTemplate="{CurrentPageReport}
{FirstPageLink} {PreviousPageLink}
{PageLinks} {NextPageLink}
{LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15"
editable="true"
selection="#{carsEntry.selectedRows}">
<p:column selectionMode="multiple" exportable="false"/>
<p:column headerText="ID" sortBy="#{cars.id}">
<h:outputText value="#{cars.id}" />
</p:column>
</p:dataTable>
<h:commandLink>
<h:outputText value="PDF" />
<p:dataExporter type="pdf"
target="dataall"
fileName="AllCars"
selectionOnly="true"/>
</h:commandLink>
Checked these two but still no clear answer.
http://forum.primefaces.org/viewtopic.php?f=3&t=31804
https://code.google.com/p/primefaces/issues/detail?id=7406
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…