Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get old value from JSF/ADF validator?

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.

like image 543
Nhut Le Avatar asked Mar 09 '10 23:03

Nhut Le


1 Answers

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();
    // ...
}
like image 92
BalusC Avatar answered Sep 28 '22 04:09

BalusC