Clear sleep validator messages

I have a page (popup) with some files. When I submit a form on this page, a check is performed and errors appear.

The problem is that if I close the popup and open it again, the error messages are still on this page. How can I clear the check on ascent again?

The page is made using JSF.

Thanks!

+1
source share
1 answer

Let ajax update the popup before opening it.

It is not clear which component library you are using for the pop-up window, but considering that it is PrimeFaces, it should look like this:

<h:form> .... <p:commandButton ... update=":dialog:form" oncomplete="dialog.open()" /> </h:form> <p:dialog id="dialog" widgetVar="dialog" visible="false" ...> <h:form id="form"> <p:messages /> ... <p:commandButton ... oncomplete="if (!args.validationFailed) dialog.hide()" /> </h:form> </p:dialog> 
+1
source

All Articles