2012-04-05 33 views
0

我们正在实现datatable上的primefaces工具提示。 但工具提示发布是远离datable行。Primefaces工具提示定位在数据表中

<p:tooltip targetPosition="bottomLeft" Delay="0" showDelay="0"> 
<h:outputText value="#{label.lockTime}" 
style="font-weight:bold" /> 
<h:outputText value=": #{cert.lockTime}" /> 
<p:spacer width="1" height="10" /> 
<h:outputText value="#{cert.label} " style="font-weight:bold" /> 
<h:outputText value=": #{cert.userDetails}" /> 
</p:tooltip> 
+0

目前Primefaces数据表中不支持工具提示。我相信Primefaces扩展项目有一个dataTable功能的工具提示组件,或者你可以看看这个问题,并实施overlaypanel黑客代替,http://stackoverflow.com/questions/9980155/jsf-2-0-primefaces-2x -tooltip-for-datatable-row – 2012-04-05 12:18:32

+0

@maple_shaft谢谢 – Vish 2012-04-05 13:36:04

回答

1

你试试这个

<p:tooltip /> 
<p:dataTable var="var" ........> 
    <p:column headerText="Market" > 
     <h:outputText value=" #{var.market}" title=" #{var.market}" 
         style="display:block;"> 
     </h:outputText>    
    </p:column> 
    <p:column headerText="Value" > 
     <h:outputText value=" #{var.value}" title=" #{var.value}" 
         style="display:block;"> 
     </h:outputText>    
    </p:column> 

</p:dataTable> 

我希望它将工作。