Package com.vaadin.ui

Examples of com.vaadin.ui.TextField.addListener()


    protected void setup() {
        TextField textField = new TextField("text field");
        textField.setImmediate(true);
        final Select select = new Select("select", Arrays.asList("1", "2", "3",
                "4"));
        textField.addListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                select.addItem(Long.valueOf(select.size() + 1).toString()); // or
                                                                            // just
                                                                            // select.requestRepaint();
View Full Code Here


    protected void setup() {
        final TextField field = new TextField();
        field.setImmediate(false);
        field.setTextChangeTimeout(2000);
        field.setTextChangeEventMode(TextChangeEventMode.TIMEOUT);
        field.addListener(new TextChangeListener() {
            @Override
            public void textChange(TextChangeEvent event) {
                // Need to add a listener for events to occur
            }
        });
View Full Code Here

        height.setImmediate(true);
        w.addComponent(width);
        w.addComponent(height);
        w.addComponent(label);
        w.addComponent(target);
        height.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                try {
                    target.setHeight(height.getValue());
                    height.setComponentError(null);
View Full Code Here

    @Override
    protected void setup() {

        final TextField tf1 = new TextField("Updates value");
        tf1.setTextChangeEventMode(TextChangeEventMode.EAGER);
        tf1.addListener(new TextChangeListener() {
            @Override
            public void textChange(TextChangeEvent event) {
                String text = event.getText();
                if (!text.matches("[a-z]*")) {
                    String newValue = text.replaceAll("[^a-z]", "");
View Full Code Here

            }
        });

        final TextField tf2 = new TextField("Updates width");
        tf2.setTextChangeEventMode(TextChangeEventMode.EAGER);
        tf2.addListener(new TextChangeListener() {
            @Override
            public void textChange(TextChangeEvent event) {
                String text = event.getText();
                if (!text.matches("[a-z]*")) {
                    tf2.setWidth("100px");
View Full Code Here

        {
            final TextField tf = new TextField("Debug");
            getLayout().addComponent(tf);

            tf.addListener(new TextChangeListener() {
                @Override
                public void textChange(TextChangeEvent event) {
                    System.err.println(tf.getCaption() + " textChange");
                }
            });
View Full Code Here

                public void textChange(TextChangeEvent event) {
                    System.err.println(tf.getCaption() + " textChange");
                }
            });

            tf.addListener(new ValueChangeListener() {
                @Override
                public void valueChange(ValueChangeEvent event) {
                    System.err.println(tf.getCaption() + " valueChange");
                }
            });
View Full Code Here

                public void valueChange(ValueChangeEvent event) {
                    System.err.println(tf.getCaption() + " valueChange");
                }
            });

            tf.addListener(new BlurListener() {

                @Override
                public void blur(BlurEvent event) {
                    System.err.println(tf.getCaption() + " blur");
                }
View Full Code Here

                public void blur(BlurEvent event) {
                    System.err.println(tf.getCaption() + " blur");
                }
            });

            tf.addListener(new FocusListener() {
                @Override
                public void focus(FocusEvent event) {
                    System.err.println(tf.getCaption() + " focus");
                }
            });
View Full Code Here

        {
            final TextField tf = new TextField("Label");
            getLayout().addComponent(tf);
            final Label l = new Label();
            getLayout().addComponent(l);
            tf.addListener(new TextChangeListener() {
                @Override
                public void textChange(TextChangeEvent event) {
                    l.setValue(event.getText());
                }
            });
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.