Tooltip For buttons and Icons

Locked
VH INFORMATICA LTDA
Posts: 6
Joined: 16 Jul 2015, 15:03

02 Sep 2015, 16:58

I need to show equals tooltips for all icons and buttons ...

My Button... (I need to show all equal as this!)
<p:commandButton id="cmdBut" icon="fa fa-facebook"/>
<p:tooltip id="ttBut" for="cmdBut" value="Tooltip"/>

My icon...
<i class="fa fa-facebook" title="Tooltip"/>

mert.sincan
Posts: 4345
Joined: 29 Jun 2013, 12:38

03 Sep 2015, 08:37

You can not use PrimeFaces Tooltip with html tags. When you add title attribute in a html tag, this tag is rendered by browser. Please try with h: or p: tags.
Also you can use global tooltip in your project;
//global tooltip
http://www.primefaces.org/showcase/ui/o ... obal.xhtml

//test code

Code: Select all

// please add in your page
..
xmlns:p="http://primefaces.org/ui"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
...

// test 
<p:tooltip />

<p:commandButton id="cmdBut" icon="fa fa-facebook" pt:data-tooltip="Tooltip 1"/>
<h:link class="fa fa-facebook" pt:data-tooltip="Tooltip 2"/>

VH INFORMATICA LTDA
Posts: 6
Joined: 16 Jul 2015, 15:03

03 Sep 2015, 14:36

Its works... but i need show tooltip only in icon, not in link...

Tanks.

VH INFORMATICA LTDA
Posts: 6
Joined: 16 Jul 2015, 15:03

03 Sep 2015, 14:43

<p:tooltip/>

<h:graphicImage pt:data-tooltip="#{msgs.tooltip}">
<i class="fa fa-plus Fs20"/>
</h:graphicImage>

mert.sincan
Posts: 4345
Joined: 29 Jun 2013, 12:38

04 Sep 2015, 16:16

Sorry, I forgot globalSelector attribute in tooltip component. Please try with;

//CSS

Code: Select all

.TestClass:hover {
   cursor: pointer;
}
// XHTML

Code: Select all

<p:tooltip /> <!-- for pt: -->
<p:tooltip globalSelector=".TestClass" /> 

<i class="TestClass fa fa-plus Fs20" data-tooltip="Tooltip 2"/>
                                        
<p:commandButton id="cmdBut" icon="fa fa-facebook" style="margin-left:50px" pt:data-tooltip="Tooltip 1"/>

VH INFORMATICA LTDA
Posts: 6
Joined: 16 Jul 2015, 15:03

04 Sep 2015, 16:36

Tanks its work!

mert.sincan
Posts: 4345
Joined: 29 Jun 2013, 12:38

04 Sep 2015, 16:45

Glad to hear, thanks ;)

Locked

Return to “Rio”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest