I have a primefaces overlay panel in my form and intention is to control the overlay panel visibility from managed bean, so i have set widgetVar to overlay and when try to hide the overlay panel from managed bean its throwing error
<p:overlayPanel id="imagePanel" for="input_ac" widgetVar="overlaypanel" showEvent="keypress" hideEffect="fade" >
<p:outputLabel value="test" />
</p:overlayPanel>
ManagedBean:
RequestContext.getCurrentInstance().execute("overlaypanel.hide()");
ERROR:
