excel exporter and datatable paging
gebuh Apr 6, 2011 1:39 PMSeam 2.2.0
I'm using a rich:dataTable for searching results display and export to excel. Before I combined them we had 2 separate dataTables (because of the setMaxResults). But now whenever a user pages forward and then exports to excel they only get the results from that point forward. Is there a way around this?
Here's some code:
export button:
<h:commandButton value="Export to Excel" type="submit" rendered = "true" action="#{excelExporter.export('employeeCertVSearch:employeeCertAllVList')}"> <f:setPropertyActionListener target="#{employeeCertAllVList.useExcel}" value="true" /> </h:commandButton>
dataTable heading:
<rich:dataTable id="employeeCertAllVList" var="_employeeCertAllV" value="#{employeeCertAllVList.resultList}" rendered="#{not empty employeeCertAllVList.resultList}" rowClasses="#{employeeCertAllVCriteria.row}" onRowMouseOver="this.style.backgroundColor='#BED6F8'" onRowMouseOut="this.style.backgroundColor='white'" style="xls-font: 10 Verdana; xls-column-widths: 4000 4000 4000 4000 5000 6000 6000 6000 10000 3000 3000 3000 3000" columnClasses="left, right" width="500px" > bunch of columns .... </rich:dataTable>
paging:
<div class="tableControl"> <s:link view="/web/EmployeeCertAllV.xhtml" rendered="#{employeeCertAllVList.previousExists}" value="#{messages.left}#{messages.left} First Page" id="firstPage"> <f:param name="firstResult" value="0"/> </s:link> <s:link view="/web/EmployeeCertAllV.xhtml" rendered="#{employeeCertAllVList.previousExists}" value="#{messages.left} Previous Page" id="previousPage"> <f:param name="firstResult" value="#{employeeCertAllVList.previousFirstResult}"/> </s:link> <s:link view="/web/EmployeeCertAllV.xhtml" rendered="#{employeeCertAllVList.nextExists}" value="Next Page #{messages.right}" id="nextPage"> <f:param name="firstResult" value="#{employeeCertAllVList.nextFirstResult}"/> </s:link> <s:link view="/web/EmployeeCertAllV.xhtml" rendered="#{employeeCertAllVList.nextExists}" value="Last Page #{messages.right}#{messages.right}" id="lastPage"> <f:param name="firstResult" value="#{employeeCertAllVList.lastFirstResult}"/> </s:link> </div>