I have a JSF 2.0 page that uses the Primefaces p: dialog component. The user can enter information in the dialog box and click "Save / Cancel". If they have a validation error, it is displayed in a dialog box. When they close or cancel the dialog, I want all the p: message components to be "destroyed", that is, if the user opens the p dialog again, they will not see the old verification messages.
Use a case: the user opens a dialog, does not fill out all required fields, clicks Save, the required error messages are displayed in the dialog box. The user presses the cancel button, which closes the dialog. Then the user clicks the button to open the dialog again. I do not want them to see previous verification messages (which they currently can).
source
share