DataExporter duplicates the values shown in datatable. For ex: If a column in datatable contains value "1", on export the value in exported file becomes "11" for every column except headers.
I am using primefaces version 5.3 and primefaces-extensions version 4.0.0
DataExporter exports duplicate values
This does not happen in the showcase, so I'm pretty sure it is a problem on your side. See http://forum.primefaces.org/viewtopic.php?f=3&t=1194 (The part about code... also google about mcve or sscce
Thanks for your response Ron!
The code I am working on is secured, thus can not share it. Also, I have analyzed it further to see when there is a <p:tooltip> tag added, then only exporter duplicates values. For reference, below is the dummy code for column specified in datatable with tooltip.
>
The code I am working on is secured, thus can not share it. Also, I have analyzed it further to see when there is a <p:tooltip> tag added, then only exporter duplicates values. For reference, below is the dummy code for column specified in datatable with tooltip.
Code: Select all
<p:column sortBy="#{car.color}" headerText="Color">
<h:outputText id="carColor" value="#{car.color}" />
<p:tooltip id="tooltipColor" for="carColor" trackMouse="true" value="#{car.color}"/>
</p:column>
Offtopic: You can in 99.9% of the cases always create an 'mcve' without violating 'security' policies. (I know, I have a security background to)
Then download the exporter source and check if it indeed processes the p:tooltip to and then make it ignore it. Or maybe you can use the rendered attribute of the tooltip with some creative EL in it that detects an export and return false.sorabh6 wrote:Also, I have analyzed it further to see when there is a <p:tooltip> tag added, then only exporter duplicates values. For reference, below is the dummy code for column specified in datatable with tooltip.
>Code: Select all
<p:column sortBy="#{car.color}" headerText="Color"> <h:outputText id="carColor" value="#{car.color}" /> <p:tooltip id="tooltipColor" for="carColor" trackMouse="true" value="#{car.color}"/> </p:column>
You can move tooltip outside of datatable(You can use selectors to find the target) or You can use extensions custom exporter to skip tooltip component.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
Because the exporter class tries to export the content of p:column component.I mean it won't skip or filter any kind of data https://github.com/primefaces/primeface ... orter.java.By the way Happy new year to you
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/
___________________
Sudheer Jonna
-
- Posts: 33
- Joined: 01 May 2012, 12:08
What i did was to move the tooltips into another column that was not being exported.
There was no special selectors required.
That solved it for me.
There was no special selectors required.
That solved it for me.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 40 guests