Primefaces数据表行的工具提示

时间:2014-10-14 09:52:20

标签: primefaces tooltip primefaces-extensions

我需要在我的数据表的某些行上自动显示工具提示,没有任何事件,我已经读过它可以使用Primefaces Extensions完成,但找不到一个有效的示例。 我不知道应该采用属性forSelector的值。

<pe:tooltip value="Click to view More Datails"
forSelector="?" shared="true"
targetPosition="top center" position="left center"
autoShow="true" />

2 个答案:

答案 0 :(得分:1)

设置自动显示属性为真

 <pe:tooltip value="AutoShow" autoShow="true"/>

您可以将此属性绑定到支持bean值...

 <p:column id="ctipo3" headerText="Estado">                                                        
        <p:commandButton id="estado"/>
         <pe:tooltip id="toolTipTrack4" for="estado" value="#{item.texto}" autoShow="#{item.texto}"/>
 </p:column>

答案 1 :(得分:0)

为了能够在数据表中显示行的工具提示,请在以下示例之后:

<pe:tooltip forSelector=".myTable tr[role=row][data-ri=#{rowIndex}]" value="#{project['myfield.tooltip']} #{obj.myfield}"/>

其中:

  • .myTable是应用于数据表的css样式: styleClass="myTable"
  • rowIndex是在datatable中定义的行索引var: rowIndexVar="rowIndex"

此工具提示将添加到<p:column>

请注意,为了能够使用Primefaces Extensions标记,您应该添加适当的xmlns:

xmlns:pe="http://primefaces.org/ui/extensions"
相关问题