adf oracle input Validator

来源:互联网 发布:沙丁鱼流量软件下载 编辑:程序博客网 时间:2024/05/17 06:37

这个和在MessageBean 方法里绑定一个方法是一样的效果


    public void inputValueNotNullalidate(FacesContext facesContext, UIComponent uiComponent,
                         Object object) throws ValidatorException{
          String inputValue = String.valueOf(object);
          System.out.println("验证走了");
          System.out.println(inputValue);
          if(null == inputValue || "" ==inputValue){
              throw new ValidatorException(new FacesMessage("必填项不能为空"));
          }          
    }

这个是自己写验证,但是这个验证效果是一样的,只有带鼠标离开焦点的时候才回出发这个验证!!!