Package com.smartgwt.client.widgets.form.validator

Examples of com.smartgwt.client.widgets.form.validator.FloatPrecisionValidator


    floatMax.setMax(Float.parseFloat(decimalMax.getValue()));
    return floatMax;
  }

  private static Validator[] createFromDigits(DigitsConstraintInfo digits, PrimitiveType type) {
    FloatPrecisionValidator floatPrecision = new FloatPrecisionValidator();
    floatPrecision.setPrecision(digits.getFractional());
    floatPrecision.setRoundToPrecision(digits.getFractional());
    IntegerRangeValidator integerDigit = null;
    FloatRangeValidator floatDigit = null;
    Validator[] validators;
    switch (type) {
      case SHORT:
View Full Code Here


        DataSourceFloatField unitCostField = new DataSourceFloatField("unitCost", "Unit Cost", 5);
        FloatRangeValidator rangeValidator = new FloatRangeValidator();
        rangeValidator.setMin(0);
        rangeValidator.setErrorMessage("Please enter a valid (positive) cost");

        FloatPrecisionValidator precisionValidator = new FloatPrecisionValidator();
        precisionValidator.setPrecision(2);
        precisionValidator.setErrorMessage("The maximum allowed precision is 2");

        unitCostField.setValidators(rangeValidator, precisionValidator);

        DataSourceBooleanField inStockField = new DataSourceBooleanField("inStock", "In Stock");
View Full Code Here

        DataSourceFloatField unitCostField = new DataSourceFloatField("unitCost", "Unit Cost", 5);
        FloatRangeValidator rangeValidator = new FloatRangeValidator();
        rangeValidator.setMin(0);
        rangeValidator.setErrorMessage("Please enter a valid (positive) cost");

        FloatPrecisionValidator precisionValidator = new FloatPrecisionValidator();
        precisionValidator.setPrecision(2);
        precisionValidator.setErrorMessage("The maximum allowed precision is 2");

        unitCostField.setValidators(rangeValidator, precisionValidator);

        DataSourceBooleanField inStockField = new DataSourceBooleanField("inStock", "In Stock");
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.form.validator.FloatPrecisionValidator

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.