2

即使用户单击了工具提示之外的区域,我也想让 PrimeFaces覆盖面板保持可见。关闭工具提示的唯一方法是关闭按钮。

如何做呢?

4

2 回答 2

10

如果您使用 Primefaces 4-SNAPSHOT,则有一个称为可解雇的属性。当您将其设置为 false 时,只能通过再次单击该按钮来关闭叠加层。

于 2013-06-12T12:32:43.817 回答
4

我不是 jquery/javascript 专家,有更优雅的解决方案。

<p:commandButton id="chartBtn" value="Basic" type="button" /> 
<p:overlayPanel id="chartPanel" widgetVar="chartPanelWidget" for="chartBtn" hideEffect="fade"
                                    onShow="$(document.body).unbind('mousedown.ui-overlay')">  
   <p:commandButton value="close" onclick="chartPanelWidhget.hide();return false;"/>
</p:overlayPanel> 
于 2012-10-21T22:07:31.037 回答