这是我的对话。
<p:dialog closeOnEscape="true" resizable="false"
header="Confirmation" widgetVar="groupconfirmation">
<center>
Do you want to remove this Pin Priority group?<br /> <br />
<p:commandButton value="Yes" oncomplete="groupconfirmation.hide()"
actionListener="#{pinProrityHandler.deletePinPriorityGroup}"
update="pinprioritygroup" />
<p:commandButton value="No"
actionListener="#{platformGroupHandler.onGroupReset}"
oncomplete="groupconfirmation.hide()" update="pinprioritygroup" />
</center>
</p:dialog>
这是我的Java代码:
try {
RequestContext.getCurrentInstance().execute("groupconfirmation.show()");
} catch (Exception e) {
logger.error("Error {}", e);
}
我不知道为什么我的代码不起作用。
我是前面的新手。
for Primefaces&lt; = 3.x
RequestContext context = RequestContext.getCurrentInstance();
context.execute("groupconfirmation.show();");
对于PrimeFaces> = 4.x
RequestContext context = RequestContext.getCurrentInstance();
context.execute("PF('groupconfirmation').show();")