我的表单中有一个primefaces覆盖面板,目的是控制来自托管bean的覆盖面板可见性,所以我将widgetVar设置为覆盖,当我尝试从托管bean隐藏覆盖面板时抛出错误
<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()");
错误:
答案 0 :(得分:2)
问题已解决,更新后的代码
RequestContext.getCurrentInstance().execute("PF('overlaypanel').hide();");