tags:

views:

259

answers:

1

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.

+1  A: 

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();
    // ...
}
BalusC
I need to cast the UIcomponent to CoreInputText instead of UIIput, but other than that, it works.
Nhut Le