PrimeFaces disable validation on cancel button
Use the attribute process="@this"
in the Cancel button. This will prevent the whole form being submitted.
Or you can use p:button
instead (however this doesn't have the actionListener
attribute). See this other Q/A
Use the attribute immediate="true"
in your cancel commandButton
. This will skip the entire processing of the form, tough, by skipping the Apply Request Values, Process Validations and Update Model Values phases.
<p:commandButton value="Cancel" update=":detailsForm" actionListener="#{userController.onDetailsEditCancel}" immediate="true"/>