Package javax.faces.validator

Examples of javax.faces.validator.LongRangeValidator


        UIInput number1 = (UIInput)facesContext.getViewRoot().findComponent("form1:number1");
        Validator[] validators = number1.getValidators();
        if (validators == null || validators.length == 0)
        {
            number1.addValidator(new LongRangeValidator(10, 1));
        }

        UIInput number2 = (UIInput)facesContext.getViewRoot().findComponent("form1:number2");
        validators = number2.getValidators();
        if (validators == null || validators.length == 0)
        {
            number2.addValidator(new LongRangeValidator(50, 20));
        }

        UIInput text = (UIInput)facesContext.getViewRoot().findComponent("form2:text");
        validators = text.getValidators();
        if (validators == null || validators.length == 0)
View Full Code Here


  public abstract boolean isDisabled();

  public void validate(FacesContext context) {
    super.validate(context);
    try {
      new LongRangeValidator(getMax(), getMin()).validate(context, this, getValue());
    } catch (ValidatorException e) {
      context.addMessage(getClientId(context), e.getFacesMessage());
    }
  }
View Full Code Here

  {
    FacesContext context = FacesContext.getCurrentInstance();

    Application app = context.getApplication();

    LongRangeValidator validator = null;

    ELContext elContext = context.getELContext();
     
    if (_bindingExpr != null)
      validator = (LongRangeValidator) _bindingExpr.getValue(elContext);

    if (validator == null) {
      String id = LongRangeValidator.VALIDATOR_ID;

      validator = (LongRangeValidator) app.createValidator(id);

      if (_bindingExpr != null)
  _bindingExpr.setValue(elContext, validator);
    }

    if (_minimumExpr != null)
      validator.setMinimum((Long) _minimumExpr.getValue(elContext));

    if (_maximumExpr != null)
      validator.setMaximum((Long) _maximumExpr.getValue(elContext));

    return validator;
  }
View Full Code Here

  }

  public void validate(FacesContext context) {
    super.validate(context);
    try {
      new LongRangeValidator(max, min).validate(context, this, getValue());
    } catch (ValidatorException e) {
      context.addMessage(getClientId(context), e.getFacesMessage());
    }
  }
View Full Code Here

TOP

Related Classes of javax.faces.validator.LongRangeValidator

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.