Examples of UserError


Examples of com.vaadin.server.UserError

        addComponent(tf);
        tf.setErrorHandler(new ErrorHandler() {

            @Override
            public void error(ErrorEvent event) {
                tf.setComponentError(new UserError("Invalid value"));
            }
        });
    }
View Full Code Here

Examples of com.vaadin.server.UserError

        return invalid;
    }

    protected void setInvalid(boolean value) {
        UserError userError = null;
        if (value) {
            userError = new UserError(
                    "Der eingegebene Wert ist nicht zulässig!");
        }

        for (AbstractField<?> c : components) {
            c.setComponentError(userError);
View Full Code Here

Examples of com.vaadin.server.UserError

    }

    protected void setError(boolean value) {
        for (AbstractField<?> c : components) {
            if (value) {
                c.setComponentError(new UserError("error"));
            } else {
                c.setComponentError(null);

            }
        }
View Full Code Here

Examples of com.vaadin.server.UserError

        Label l = new Label("Label");
        l.setDescription("This is a label");

        Tab tab = tabSheet.addTab(l, "Tab", null);
        tab.setDescription("This is a tab");
        tab.setComponentError(new UserError("abc error"));

        Tab tab2 = tabSheet.addTab(new Label("Another label, d'oh"), "Tab 2",
                null);
        tab2.setDescription("This is another tab");
View Full Code Here

Examples of com.vaadin.server.UserError

        cb.setImmediate(true);
        cb.setWidth("200px"); // must have with to reproduce

        cb.addListener(new ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                cb.setComponentError(new UserError("Error"));
            }
        });

        addComponent(cb);
View Full Code Here

Examples of com.vaadin.server.UserError

            if (useIcon) {
                comp.setIcon(ICONS[i]);
            }
            if (ErrorMessage != null) {
                if (ErrorMessage.length() == 0) {
                    comp.setComponentError(new UserError(null));
                } else {
                    comp.setComponentError(new UserError(ErrorMessage));
                }
            }
            // if component is a tab sheet add two tabs for it
            if (comp instanceof TabSheet) {
                comp.setSizeUndefined();
View Full Code Here

Examples of com.vaadin.server.UserError

    }

    protected void setError(boolean value) {
        for (AbstractField<?> c : components) {
            if (value) {
                c.setComponentError(new UserError("error"));
            } else {
                c.setComponentError(null);

            }
        }
View Full Code Here

Examples of com.vaadin.server.UserError

        layout.addComponent(new Label("Default /w error"));
        tooltip = new Label("Hover over me to see the tooltip");
        tooltip.setSizeUndefined();
        tooltip.setDescription("Default tooltip content");
        tooltip.setComponentError(new UserError(
                "Error inside tooltip together with the regular tooltip message."));
        layout.addComponent(tooltip);

        return layout;
    }
View Full Code Here

Examples of com.vaadin.server.UserError

    @Override
    protected void setup() {
        Button bb = new Button("Button with CompositeError");
        List<UserError> errors = new ArrayList<UserError>();
        errors.add(new UserError("Error 1"));
        errors.add(new UserError("Error 2"));
        bb.setComponentError(new CompositeErrorMessage(errors));
        addComponent(bb);

        TextField tf = new TextField("", "Textfield with UserError");
        tf.setComponentError(new UserError("This is a failure"));
        addComponent(tf);

        ComboBox cb = new ComboBox("ComboBox with description and UserError");
        cb.setDescription("This is a combobox");
        cb.setComponentError(new UserError("This is a failure"));
        addComponent(cb);

    }
View Full Code Here

Examples of com.vaadin.server.UserError

        Button toggleError = new Button("Toggle error");
        toggleError.setId(BUTTON_ID);
        toggleError.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                tf.setComponentError(tf.getComponentError() == null ? new UserError(
                        "foo") : null);
            }
        });
        hl.addComponent(toggleError);
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.