Question

I have a requirement to validate an JSF/ADF input field only if the value of that field changed by users. If the value on the page is the same as the value in the model, skip validation for that field.

I am using JSF and Oracle ADF Faces, I know JSF life cycle and I can make my own converter or validator, but I can't find the old value anywhere.

Was it helpful?

Solution

During validation the old value should be available by UIInput#getValue().

public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
    Object oldValue = ((UIInput) component).getValue();
    // ...
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top