Page 1 of 1

dataExporter, export of header text with tooltips

Posted: 11 Mar 2015, 14:20
by tjahe
Hi
I'm running org='org.primefaces' name='primefaces' rev='4.0.8'
I've got a minor problem, in a datatable there are some tooltips on some of the colums. All colums where there is a tooltips, the colum name isn't exported correctly (an id is exported as name: javax.faces.component.UIPanel@1c12709)

This works fine

Code: Select all

<p:column sortBy="#{nemrResponse.status}" style="width:132px;"
	filterBy="#{nemrResponse.status.status}">
	<f:facet name="header">
		<h:outputText value="#{label['table.status']}" />
	</f:facet>
	<h:outputText value="#{nemrResponse.status.status}"
		style="#{nemrResponse.status.statusCode != 5 ? 'color: red' : ''}" />
</p:column>
this here don't

Code: Select all

<p:column sortBy="#{nemrResponse.autoSign}" style="width:100px;">
	<f:facet name="header">
		<h:outputText value="#{label['table.auto']}" />
		<p:spacer width="5px" />
		<p:graphicImage id="helptext_12"
			value="/resources/themes/images/help1.png" />
		<p:tooltip for="helptext_12" showEffect="fade"
			hideEffect="fade" style="width:380px;">
			<div class="tto">
				<div class="tti">#{label.helptext_12}</div>
			</div>
		</p:tooltip>
	</f:facet>
	<h:outputText value="#{nemrResponse.autoSign == 1 ? 'Ja' : 'Nej'}" />
</p:column>
is there a way to show the tooltip and still exporting the correct column name?

btw
I know that i can show the tooltip by using a global tooltip and then use the title="", but how then to show the image icon, which indicates that there is a helptext

Code: Select all

<p:tooltip/>
<p:column sortBy="#{nemrResponse.autoSign}" style="width:100px;" >
	<f:facet name="header">
	       <h:outputText value="#{label['table.auto']}" title="#{label.helptext_autoSign}" />
	</f:facet>
	<h:outputText value="#{nemrResponse.autoSign == 1 ? 'Ja' : 'Nej'}" title="#{nemrResponse.autoSign == 1 ? 'Ja' : 'Nej'}" />
</p:column>

regards
Anders

Re: dataExporter, export of header text with tooltips

Posted: 11 Mar 2015, 18:57
by sudheer
You can move the tooltip components outside the datatable component

Re: dataExporter, export of header text with tooltips

Posted: 12 Mar 2015, 09:38
by tjahe
Yes but what about the image, which shows a "?" after the outputText (indicates that there is a help text) How can i show that?

Maybee i have to write my own dataExporter in order to handle more than just the <h: outputText > in the facet tag or?

Re: dataExporter, export of header text with tooltips

Posted: 22 Mar 2015, 07:27
by sudheer
You can use custom exporter feature for your own customization http://www.primefaces.org/showcase-ext/ ... porter.jsf

Re: dataExporter, export of header text with tooltips

Posted: 18 Dec 2018, 10:31
by Ireth
I know this post is very old, but I faced the same issue.

My workaround is to set the column with the tooltip as exportable=false and to duplicate the same column with style="display: none".
This works for me.

Code: Select all

<p:column headerText="#{bmsg.doc_no}" exportable="false">
	 <h:outputText value="#{row.entity.documentNo}" id="colTool2"/>
	 <p:tooltip for="colTool2" value="#{row.entity.description}" position="right"/>
</p:column>

<p:column headerText="#{bmsg.doc_no}" style="display: none !important;">
	<h:outputText value="#{row.entity.documentNo}"/>
</p:column>