Bug in DataExporter Primefaces 10

UI Components for JSF
Post Reply
stavrosmachinima
Posts: 11
Joined: 27 Oct 2021, 09:49

12 Jan 2022, 15:19

Hi, i just upgraded from primefaces 8 to 10, and have noticed something weird.

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>
For some strange reason it exports the word 'From: ' as well. Image in following link
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?
JSF 2.0
Primefaces 11.0
Tomcat 8.5.57.0
Servlet 3.1
JSP 2.3
Java 1.8.0

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

13 Jan 2022, 21:33

I think this is fixed in PF 11. Can you try it.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

stavrosmachinima
Posts: 11
Joined: 27 Oct 2021, 09:49

18 Jan 2022, 16:53

Just upgraded to PF 11, unfortunately problem still persists.
JSF 2.0
Primefaces 11.0
Tomcat 8.5.57.0
Servlet 3.1
JSP 2.3
Java 1.8.0

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

18 Jan 2022, 16:57

Please create a PrimeFaces Test Reproducer and then report your reproducible issue on the GitHub Issues page.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests