2
votes

I would like to make PrimeFaces Overlay Panel to stay visible even if user has clicked area outside the tooltip. The only way to close the tooltip would be Close button on it.

How can it be done?

2

2 Answers

10
votes

If you use Primefaces 4-SNAPSHOT there is a attribute called dismissable. When you set it to false, the overlay can only be closed by clicking on the button again.

4
votes

Im not jquery/javascript expert, there colud be more elegant solutions.

<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>