I thought DataExporter is supposed to export only <p:column tags, but in primefaces 10 it also exports the outputLabel in the facet header.
My xhtml code is
Code: Select all
<p:dataTable id="results" var="stavrosattempt" value="#{stavrosattempt_r.results}"
paginator="true" rows="30"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="30"
currentPageReportTemplate="(Displaying {startRecord} - {endRecord} of
{totalRecords} Total Records, Page: {currentPage}/{totalPages})" sortMode="multiple"
tableStyle="auto">
<f:facet name="header">
<!-- From: -->
<h:outputLabel for="d_period1" value="From: " style="font-weight:bold" exportable="false" />
<p:inputText id="d_period1" value="#{stavrosattempt_r.fromMonth}" />
<p:watermark for="d_period1" value="MM/YYYY" id="watermark1" style="text-align: center;" />
<!--To: -->
<h:outputLabel for="d_period2" value=" To: " style="font-weight:bold" />
<p:inputText id="d_period2" value="#{stavrosattempt_r.toMonth}" />
<p:watermark for="d_period2" value="MM/YYYY" id="watermark2" style="text-align: center;" />
<p:commandButton value="Report" id="ajax" update=":editStatus:results" action="#{stavrosattempt_r.report}" style="margin-left:20px;" styleClass="btn btn-secondary" />
<p:growl for="d_period1" />
<p:commandButton id="exportaggrMeteringss" value="CSV Export" icon="ui-icon-export" ajax="false" style="float:left" >
<p:dataExporter type="csv" target="results" fileName="#{stavrosattempt_r.file_name}" pageOnly="false" />
<br></br>
</p:commandButton>
<p:commandButton id="xlsexportaggrMeteringss" value="EXCEL Export" icon="ui-icon-export" ajax="false" style="float:left" >
<p:dataExporter type="xlsx" target="results" fileName="#{stavrosattempt_r.file_name}" postProcessor="#{stavrosattempt_r.postProcessXLS}" pageOnly="false" />
</p:commandButton>
<br></br> <br></br>
</f:facet>
<p:column>
<f:facet name="header">
<h:outputText value="Year" />
</f:facet>
<h:outputText value="#{stavrosattempt.ref_year}" escape="true" style="display:block;text-align: center" />
</p:column>
[i]-- rest of columns--[/i]
</p:dataTable>
https://ibb.co/C7VGdHJ
If i comment out the the outlabel, it exports the next value in the following inputText.
***EDIT**
Csv works just fine, exporting only the column tags.
Is this a bug? If i upgrade to 11, will it resolve itself?