Am Upgrading application from PrimeFaces 6.1 to PrimeFaces 6.2. I have <p:dialog appendTo="@(body)" id="dialog" widgetVar="widgetVar" modal="true">
with <p:message id="validation">
element inside it.
Am opening dialog using PF('widgetVar').show()
. When I click p:commandButton
inside dialog, doing some validation and showing message using below code,
FacesContext.getCurrentInstance().addMessage("validation", new
FacesMessage(FacesMessage.SEVERITY_ERROR, "validation error", null))
With in the same method am reopening dialog and update it with below code,
RequestContext context = RequestContext.getCurrentInstance();
context.update("dialog");
context.execute("PF('widgetVar').show();")
In PrimeFaces 6.1 its working fine and validation message getting displayed. But in PrimeFaces 6.2 validation Message not displaying in dialog. I know RequestContext is deprecated in PF 6.2. Am also tried with below code,
PrimeFaces primefaces = PrimeFaces.current();
primefaces.ajax().update("dialog");
primefaces.executeScript("PF('widgetVar').show();");
Facing same issue. I saw that message displaying and immediately its getting cleared.
But, when I remove the ajax update primefaces.ajax().update("dialog");
It's working fine.
What is the reason for this issue?