dataExporter, export of header text with tooltips

Community Driven Extensions Project
Post Reply
tjahe
Posts: 2
Joined: 11 Mar 2015, 12:41

11 Mar 2015, 14:20

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

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

11 Mar 2015, 18:57

You can move the tooltip components outside the datatable component
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

tjahe
Posts: 2
Joined: 11 Mar 2015, 12:41

12 Mar 2015, 09:38

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?

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

22 Mar 2015, 07:27

You can use custom exporter feature for your own customization http://www.primefaces.org/showcase-ext/ ... porter.jsf
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Ireth
Posts: 4
Joined: 20 May 2013, 10:07

18 Dec 2018, 10:31

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>

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest