Requirement is to skip field validation conditionally. When user selects add, the form fields should be validated and values added to the table. If edit is clicked, form fie
Your code is incomplete as you're nowhere showing how disableBeanValidation
is implemented and how you're passing the #{param[skipBeanValidation]}
around.
But it should basically boil down to:
<f:validateBean disabled="#{param.skipBeanValidation}" />
...
<h:commandLink value="Edit" action="#{buyerBacking.edit}"/>
<f:param name="skipBeanValidation" value="true" />
</h:commandLink>
Please note that #{param.skipBeanValidation}
is quite different from #{param[skipBeanValidation]}
(but the same as #{param['skipBeanValidation']}
). Also please note that the desired request parameter to skip the bean validation is been passed as a HTTP request parameter, exactly as is been expected by #{param}
.