I have a JSF 2.0 page that uses Primefaces p:dialog component. The user can enter information in the dialog and click save/cancel. If they have a validation error, it is shown on the dialog. When they close or cancel the dialog, I want any p:message components to be "wiped out", i.e. so that if the user then opens p the dialog again, they wont see old validation messages.
Use case is: user opens dialog, doesnt fill all required fields, clicks Save, required field error messages are shown in the dialog. User clicks cancel which closes the dialog. User then clicks the button to open up the dialog again. I dont want them to see the previous validation messages (which currently they can).