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

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


  private static Validator createFromSize(SizeConstraintInfo size, PrimitiveType type) {
    switch (type) {
      case STRING:
      case URL:
      case IMGURL:
        LengthRangeValidator lengthRange = new LengthRangeValidator();
        lengthRange.setMax(size.getMin());
        lengthRange.setMax(size.getMax());
        return lengthRange;
    }
    return null;
  }
View Full Code Here


        Integer maxLength, Boolean required) {
        DataSourceTextField textField = new DataSourceTextField(name, title);
        textField.setLength(maxLength);
        textField.setRequired(required);
        if (minLength != null || maxLength != null) {
            LengthRangeValidator lengthRangeValidator = new LengthRangeValidator();
            lengthRangeValidator.setMin(minLength);
            lengthRangeValidator.setMax(maxLength);
            textField.setValidators(lengthRangeValidator);
        }
        return textField;
    }
View Full Code Here

                        wizard.setDeploymentDescription(MSG.view_bundle_revertWizard_getInfoStep_revertDeployDescFull(
                            escapedLiveDesc, escapedPrevDesc));
                        descriptionTextAreaItem.setValue(StringUtility.escapeHtml(wizard.getDeploymentDescription()));
                        descriptionTextAreaItem.setValidateOnChange(true);
                        descriptionTextAreaItem.setValidateOnExit(true);
                        LengthRangeValidator validator = new LengthRangeValidator();
                        validator.setMin(0);
                        validator.setMax(500); // database column limit
                        descriptionTextAreaItem.setValidators(validator);
                        descriptionTextAreaItem.addChangedHandler(new ChangedHandler() {
                            public void onChanged(ChangedEvent event) {
                                Object value = event.getValue();
                                if (value == null) {
View Full Code Here

        switch (propertyDefinition.getType()) {
        case STRING:
        case LONG_STRING:
        case FILE:
        case DIRECTORY:
            LengthRangeValidator lengthRangeValidator = new LengthRangeValidator();
            lengthRangeValidator.setMax(PropertySimple.MAX_VALUE_LENGTH);
            typeValidator = lengthRangeValidator;
            break;
        case INTEGER:
            typeValidator = new IsIntegerValidator();
            break;
View Full Code Here

        ldapField.setCanEdit(false); // read-only
        fields.add(ldapField);

        DataSourcePasswordField passwordField = new DataSourcePasswordField(Field.PASSWORD,
            MSG.common_title_password(), 100, true);
        LengthRangeValidator passwordValidator = new LengthRangeValidator();
        passwordValidator.setMin(6);
        passwordValidator.setMax(100);
        passwordField.setValidators(passwordValidator);
        fields.add(passwordField);

        DataSourcePasswordField passwordVerifyField = new DataSourcePasswordField(Field.PASSWORD_VERIFY,
            MSG.dataSource_users_field_passwordVerify(), 100, true);
View Full Code Here

        form.setWidth100();
        form.setWrapItemTitles(false);
        form.setNumCols(2);
        final TextItem name = new TextItem(FIELD_NAME, MSG.common_title_name());
        name.setRequired(true);
        LengthRangeValidator nameLengthValidator = new LengthRangeValidator();
        nameLengthValidator.setMin(3);
        nameLengthValidator.setMax(100);
        name.setValidators(nameLengthValidator);
        name.addKeyUpHandler(new KeyUpHandler() {
            public void onKeyUp(KeyUpEvent event) {
                if ("Enter".equals(event.getKeyName())) {
                    createNewGroup(modalWindow, form);
View Full Code Here

TOP

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

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.