如何在JSF中添加条件工具提示

时间:2017-03-20 04:10:43

标签: html jsf jsf-2 tooltip

您好我需要根据标志值(true / false)在jsf元素中显示工具提示。

元素:

<h:outputLabel value="#{msg['dealsheet.label.nonpromoted']}" />

工具提示文字:&#34; 这表示交易的状态&#34;

条件: #{ds.partialLockOutFlag}

当上述标志的值为true时,悬停时标签上的工具提示消息应该是可见的。

有人可以建议如何实现这个目标吗?

1 个答案:

答案 0 :(得分:1)

您可以在为true时显示消息,否则显示空字符串:

<h:outputLabel value="#{msg['dealsheet.label.nonpromoted']}" title="#{ds.partialLockOutFlag} ? 'This denotes the status of the deal' : '' " />