添加一个关闭按钮到富:工具提示

时间:2012-10-22 14:03:22

标签: jsf richfaces

是否有一种简单的方法可以向rich:toolTip添加“关闭按钮”(以便在点击此按钮之前它仍然可见)?

非常感谢

2 个答案:

答案 0 :(得分:1)

使用代码hideEvent="none"

<rich:toolTip name="tooltipTest" id="tooltipTest" hideEvent="none">
    <a4j:commandButton value="Close" onclick="#{rich:component('tooltipTest')}.hide(); return false;" />
</rich:toolTip>

答案 1 :(得分:0)

richfaces提供了另一个名为rich:popupPanel的组件来实现这一点。

<h:panelGrid onmouseover="#{rich:component('popup')}.show()">
    <h:outputText value="Open popup" />
</h:panelGrid>
<rich:popupPanel id="popup" modal="false" autosized="true" resizeable="false">
<f:facet name="controls">
    <h:outputLink value="#"
        onclick="#{rich:component('popup')}.hide(); return false;">X</h:outputLink>
</f:facet>
...
</rich:popupPanel>