2014-02-17 43 views
0

我想用fontawesome的提示文字,但我不知道如何實現它。它與覆蓋面板一起工作,但我想使用<p:tooltip>標記。工具提示與Fontawesome圖標

我用primefaces 4.0和JSF 2.1 這裏是代碼與提示

<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet" /> 
<p:graphicImage id="grap" class="fa fa-question-circle fa-2x"/> 
<p:tooltip for="grap" value="Some Help" showEffect="fade" /> 

如果我用它工作

<h:panelGroup id="mail" class="fa fa-question-circle fa-2x" /> 
<p:overlayPanel for="mail" showEvent="mouseover" hideEvent="mouseout" hideEffect="fade"> 
    <p:panel> 
     TEXTTEXTTEXT 
    </p:panel> 
    </p:overlayPanel> 
+0

必須由事故工作,然後。嘗試'styleClass'屬性而不是'class'。 – mabi

+0

如果我使用styleClass – bvb1909

回答

2

下面這也許是你在找什麼。它適用於Primefaces 6.0和JSF 2.3.0。

<p:outputLabel id ="idEmptyLabel"> 
    <i class="fa fa-question-circle fa-2x"/> 
</p:outputLabel> 
<p:tooltip for="idEmptyLabel" value="It works!" /> 
+0

不顯示任何內容。當你將鼠標懸停在圖標上時,彈出工具提示。這就是@ bvb1909所問的。 –