Package com.vaadin.ui

Examples of com.vaadin.ui.Form.addField()


        addComponent(tf);

        Form f = new Form();
        TextField tf2 = new TextField("A field in a read only form");
        tf2.setRequired(true);
        f.addField("Field-1", tf2);
        f.setReadOnly(true);
        addComponent(f);
    }
}
View Full Code Here


        final TextField requiredFieldWithError = new TextField(
                "Field with requiredError");
        requiredFieldWithError.setRequired(true);
        requiredFieldWithError
                .setRequiredError("Error message for required field");
        form.addField("field1", requiredFieldWithError);

        final TextField requiredFieldNoError = new TextField(
                "Field without requiredError");
        requiredFieldNoError.setRequired(true);
        form.addField("field2", requiredFieldNoError);
View Full Code Here

        form.addField("field1", requiredFieldWithError);

        final TextField requiredFieldNoError = new TextField(
                "Field without requiredError");
        requiredFieldNoError.setRequired(true);
        form.addField("field2", requiredFieldNoError);

        final TextField requiredFieldDescriptionAndError = new TextField(
                "Field with requiredError and description");
        requiredFieldDescriptionAndError.setRequired(true);
        requiredFieldDescriptionAndError
View Full Code Here

        requiredFieldDescriptionAndError.setRequired(true);
        requiredFieldDescriptionAndError
                .setRequiredError("Error message for required field");
        requiredFieldDescriptionAndError
                .setDescription("Description message for the field");
        form.addField("field3", requiredFieldDescriptionAndError);

        main.addComponent(form);
    }

}
View Full Code Here

    }

    private Form buildForm(String caption, boolean withError, boolean withFooter) {
        Form form = new Form();
        form.setCaption(caption);
        form.addField("value", new TextField("MyField"));

        if (withError) {
            form.setComponentError(new UserError("Has error"));
        }
View Full Code Here

        TextField tf = new TextField("A field, must contain 1-2 chars");
        tf.addValidator(new StringLengthValidator("Invalid length", 1, 2, false));
        tf.setRequired(true);
        tf.setValue("ab");
        form.addField("a", tf);

        tf = new TextField("A field, must contain an integer");
        tf.addValidator(new IntegerValidator("Invalid integer {0}"));
        tf.setRequired(true);
        tf.setValue("123");
View Full Code Here

        tf = new TextField("A field, must contain an integer");
        tf.addValidator(new IntegerValidator("Invalid integer {0}"));
        tf.setRequired(true);
        tf.setValue("123");
        form.addField("b", tf);

        tf = new TextField("A field, must contain an integer or be empty");
        tf.addValidator(new IntegerValidator("Invalid integer {0}"));
        tf.setValue("-321");
        form.addField("c", tf);
View Full Code Here

        form.addField("b", tf);

        tf = new TextField("A field, must contain an integer or be empty");
        tf.addValidator(new IntegerValidator("Invalid integer {0}"));
        tf.setValue("-321");
        form.addField("c", tf);

        tf = new TextField(
                "A field, must contain a floating point number or be empty");
        tf.addValidator(new DoubleValidator("Invalid double {0}"));
        tf.setValue("-123.45e6");
View Full Code Here

        tf = new TextField(
                "A field, must contain a floating point number or be empty");
        tf.addValidator(new DoubleValidator("Invalid double {0}"));
        tf.setValue("-123.45e6");
        form.addField("d", tf);

        tf = new TextField(
                "A field, must contain an e-mail address or be empty");
        tf.addValidator(new EmailValidator("Invalid e-mail address {0}"));
        tf.setValue("a.b@example.com");
View Full Code Here

        tf = new TextField(
                "A field, must contain an e-mail address or be empty");
        tf.addValidator(new EmailValidator("Invalid e-mail address {0}"));
        tf.setValue("a.b@example.com");
        form.addField("e", tf);

        // regular expressions

        tf = new TextField("A field, must match the regular expression a.*b.*c");
        tf.addValidator(new RegexpValidator("a.*b.*c",
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.