Package org.richfaces.validator

Examples of org.richfaces.validator.FacesBeanValidator


            }
        }
    }

    public Validator createChildrenValidator() {
        FacesBeanValidator validator = (FacesBeanValidator) getFacesContext().getApplication().createValidator(getType());
        validator.setSummary(getSummary());
        ValueExpression expression = getValueExpression("groups");
        if (null != expression) {
            validator.setGroups(expression);
        } else {
            validator.setGroups(getGroups());
        }
        return validator;
    }
View Full Code Here


            }
        }

        if (defaultValidator != null && defaultValidator instanceof BeanValidator) {
            if (beanValidator instanceof FacesBeanValidator) {
                FacesBeanValidator facesBeanValidator = (FacesBeanValidator) beanValidator;
                facesBeanValidator.setValidateFields(false);
            }
            BeanValidator defaultBeanValidator = (BeanValidator) defaultValidator;
            Class<?>[] groups = parameterObject.getGroups();
            if(null ==  defaultBeanValidator.getValidationGroups() && null != groups && groups.length >0){
                defaultBeanValidator.setValidationGroups(GROUPS_JOINER.join(Iterables.transform(Arrays.asList(groups), CLASS_TO_NAME)));
View Full Code Here

  protected Validator createValidator() throws JspException {
    ValueExpression ve = this.binding;
   
    FacesContext facesContext = FacesContext.getCurrentInstance();
   
    FacesBeanValidator validator = null;
   
    try {
      ELContext elContext = facesContext.getELContext();
      if (ve != null) {
        validator = (FacesBeanValidator) ve.getValue(elContext);
View Full Code Here

    }
    // Nothing to do unless this tag created a component
    if (tag.getCreated()) {
      // New created component, add validator.
      FacesContext facesContext = FacesContext.getCurrentInstance();
      FacesBeanValidator validator = (FacesBeanValidator) facesContext
          .getApplication().createValidator(
              FacesBeanValidator.BEAN_VALIDATOR_TYPE);
      if (null != summary) {
          validator.setSummary(summary);
      }
      ((EditableValueHolder) component).addValidator(validator);

    }
    return super.doStartTag();
View Full Code Here

    _summary = getAttribute("summary");
  }

  @Override
  protected Validator createValidator(FaceletContext ctx) {
    FacesBeanValidator validator = (FacesBeanValidator) ctx.getFacesContext()
        .getApplication().createValidator(
            FacesBeanValidator.BEAN_VALIDATOR_TYPE);
    if (null != _summary) {
      validator
          .setSummary(_summary.getValueExpression(ctx, String.class));
    }
    return validator;
  }
View Full Code Here

  }
 
  @Override
  public void encodeBegin(FacesContext context) throws IOException {
    super.encodeBegin(context);
    FacesBeanValidator validator = (FacesBeanValidator)context.getApplication().createValidator(getType());
    validator.setSummary(getSummary());
    setupValidators(this,validator);
  }
View Full Code Here

          "Parent not an instance of EditableValueHolder: " + parent);
    }
    if (null == parent.getParent()) {
      // New created component, add validator.
      FacesContext facesContext = FacesContext.getCurrentInstance();
      FacesBeanValidator validator = (FacesBeanValidator) facesContext
          .getApplication().createValidator(
              FacesBeanValidator.BEAN_VALIDATOR_TYPE);
      if (null != _summary) {
        if (_summary.isLiteral()) {
          validator.setSummary(_summary.getValue(ctx));

        } else {
          validator.setSummary(_summary.getValueExpression(ctx,
              String.class));
        }
      }
      if( null != _profiles){
        if(_profiles.isLiteral()){
          validator.setProfiles(AjaxRendererUtils.asSet(_profiles.getValue()));
        } else {
          validator.setProfiles(_profiles.getValueExpression(ctx, Set.class));
        }
      }
      ((EditableValueHolder) parent).addValidator(validator);
    }
    if (null != this._event) {
View Full Code Here

  }
 
  @Override
  public void encodeBegin(FacesContext context) throws IOException {
    super.encodeBegin(context);
    FacesBeanValidator validator = (FacesBeanValidator)context.getApplication().createValidator(getType());
    validator.setSummary(getSummary());
    ValueExpression expression = getValueExpression("profiles");
    if(null != expression){
      validator.setProfiles(expression);
    } else {
      validator.setProfiles(getProfiles());
    }
    setupValidators(this,validator);
  }
View Full Code Here

          "Parent not an instance of EditableValueHolder: " + parent);
    }
    if (null == parent.getParent()) {
      // New created component, add validator.
      FacesContext facesContext = FacesContext.getCurrentInstance();
      FacesBeanValidator validator = (FacesBeanValidator) facesContext
          .getApplication().createValidator(
              FacesBeanValidator.BEAN_VALIDATOR_TYPE);
      if (null != _summary) {
          validator.setSummary(_summary.getValueExpression(ctx, String.class));
      }
      ((EditableValueHolder) parent).addValidator(validator);
    }
    if (null != this._event) {
      UIComponent c;
View Full Code Here

  protected Validator createValidator() throws JspException {
    ValueExpression ve = this.binding;
   
    FacesContext facesContext = FacesContext.getCurrentInstance();
   
    FacesBeanValidator validator = null;
   
    try {
      ELContext elContext = facesContext.getELContext();
      if (ve != null) {
        validator = (FacesBeanValidator) ve.getValue(elContext);
View Full Code Here

TOP

Related Classes of org.richfaces.validator.FacesBeanValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.