Package com.vaadin.server

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


        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

        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

            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

    }

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

            }
        }
View Full Code Here

        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

    @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

        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

    private TabSheet createTabSheetWith(String caption, String styleName) {
        TabSheet ts = new TabSheet();
        ts.setId("tabsheet" + debugIdCounter++);
        ts.setCaption(caption);
        ts.setComponentError(new UserError("A error message"));

        Label content = new Label("First Component");
        ts.addTab(content, "First");
        Label content2 = new Label("Second Component");
        ts.addTab(content2, "Second");
View Full Code Here

        form.addComponent(email);

        TextField location = new TextField("Location");
        location.setValue(sg.nextString(true) + ", " + sg.nextString(true));
        location.setWidth("50%");
        location.setComponentError(new UserError("This address doesn't exist"));
        form.addComponent(location);

        TextField phone = new TextField("Phone");
        phone.setWidth("50%");
        form.addComponent(phone);
View Full Code Here

TOP

Related Classes of com.vaadin.server.UserError

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.