Package com.vaadin.data.validator

Examples of com.vaadin.data.validator.StringLengthValidator


    form.addField("password", new PasswordField(i18nManager.getMessage(Messages.USER_PASSWORD)));
    form.getField("password").setRequired(true);
    form.getField("password").setRequiredError(i18nManager.getMessage(Messages.USER_PASSWORD_REQUIRED));
   
    // Password must be at least 5 characters
    StringLengthValidator passwordLengthValidator = new StringLengthValidator(i18nManager.getMessage(Messages.USER_PASSWORD_MIN_LENGTH, 5), 5, -1, false);
    form.getField("password").addValidator(passwordLengthValidator);
   
    form.addField("firstName", new TextField(i18nManager.getMessage(Messages.USER_FIRSTNAME)));
    form.addField("lastName", new TextField(i18nManager.getMessage(Messages.USER_LASTNAME)));
    form.addField("email", new TextField(i18nManager.getMessage(Messages.USER_EMAIL)));
View Full Code Here


            RichTextArea rta = new RichTextArea();
            if (taw.getVisibleLines() != null) {
                rta.setHeight(taw.getVisibleLines() * 2 + 4, Sizeable.UNITS_EM);
            }
            if (taw.getLimit() != null) {
                rta.addValidator(new StringLengthValidator(getMessage("processdata.block.error.text.exceeded").replaceFirst("%s",
                        "" + taw.getLimit()), 0, taw.getLimit(), true));
            }
            if (nvl(taw.getRequired(), false)) {
                rta.setRequired(true);
                if (hasText(taw.getCaption())) {
View Full Code Here

    form.addField("password", new PasswordField(i18nManager.getMessage(Messages.USER_PASSWORD)));
    form.getField("password").setRequired(true);
    form.getField("password").setRequiredError(i18nManager.getMessage(Messages.USER_PASSWORD_REQUIRED));
   
    // Password must be at least 5 characters
    StringLengthValidator passwordLengthValidator = new StringLengthValidator(i18nManager.getMessage(Messages.USER_PASSWORD_MIN_LENGTH, 5), 5, -1, false);
    form.getField("password").addValidator(passwordLengthValidator);
   
    form.addField("firstName", new TextField(i18nManager.getMessage(Messages.USER_FIRSTNAME)));
    form.addField("lastName", new TextField(i18nManager.getMessage(Messages.USER_LASTNAME)));
    form.addField("email", new TextField(i18nManager.getMessage(Messages.USER_EMAIL)));
View Full Code Here

TOP

Related Classes of com.vaadin.data.validator.StringLengthValidator

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.