I have a form with lets say 3 fields:
- password hint
- password
- password again
I have a bean, which contains these 3 fields, and I have a class level validator, which checks if the bean has a matching password
and password again
field. Imagine a pretty similar setup, like it is at https://github.com/AnghelLeonard/JSF-2.3/tree/master/JSF23ValidateWholeBeanExample
The problem which I face, that I enter a password hint
, a password
and a non matching password again
. This case I get the whole form cleared, since as it seems to me, the WholeBeanValidator prevents JSF from saving any value into the model. The relevant code place is in com.sun.faces.ext.component.WholeBeanValidator.validate(FacesContext, UIValidateWholeBean, Object):
// Mark the components as invalid to prevent them from receiving
// values during updateModelValues
for (Entry<String, Map<String, Object>> validationCandidateEntry : validationCandidate.entrySet()) {
invalidateComponent(validationCandidateEntry);
}
throw toThrow;
This case I think it would be good to keep the model values in the fields and to get the global error message. However the values do not come into the bean. Do I understand something wrong? Could you help me in this @BalusC :)?