I would like to have an illustrative explanation about the difference between getValue() and getLocalValue() methods of UIInput components in the aspect of performing multiple field validation: jsf validate two fields in one time.
What is the difference in usage of this methods if the fields are already validated? The ValueHolder API documentation is not very helpful in answering this.
If the
UIInputcomponent has been validated beforehand and is marked invalid (i.e.isValid()method returnsfalse), then thegetLocalValue()returnsnull, but thegetValue()returns the old model value, if any. If it’s marked valid, then both returns the same value, namely the submitted, converted and validated value.You’d like to add a check on
isValid()beforehand. You may find the source code examples of the OmniFaces multiple field validators helpful. See theValidateMultipleFieldssource code link at the bottom of the<o:validateEqual>showcase page.See also: