If the UIInput
component has been validated beforehand and is marked invalid (i.e. isValid()
method returns false
), then the getLocalValue()
returns null
, but the getValue()
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 the ValidateMultipleFields
source code link at the bottom of the <o:validateEqual>
showcase page.
See also:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…