Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.39 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to check a textbox value when the user press tab
  2. @FacesValidator("input1Validator")
  3. public class Input1Validator implements Validator {
  4.  
  5.     @Override
  6.     public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
  7.         if (isInvalid(value)) {
  8.             throw new ValidatorException(new FacesMessage("Invalid field!"));
  9.         }
  10.     }
  11.  
  12. }