当我调用showMessage()
方法时,我收到此错误:
MalformedXML : 'dlg1' is undefined
这是我的代码:
addApplicant.xhtml
<p:dialog id="record_error" header="Applicant" widgetVar="dlg1" minHeight="40" >
<h:outputText value="Applicant already exists" />
</p:dialog>
addApplicantBacking.java:
public void showMessage() {
RequestContext context = RequestContext.getCurrentInstance();
context.execute("dlg1.show();");
}
答案 0 :(得分:0)
在PrimeFaces 5中,您需要执行PF('dlg1').show()
- (感谢RevanProdigalKnight)