繁体   English   中英

数据表行的Primefaces工具提示

[英]Primefaces tooltip for a datatable row

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

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

将自动显示属性设置为true

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

您可以将此属性绑定到backingbean值...

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

为了能够在数据表中显示一行的工具提示,例如:

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

哪里:

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

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

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

xmlns:pe="http://primefaces.org/ui/extensions"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM