Package com.vaadin.ui

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


        c.setEnabled(enable);
        c.setCaption((enable ? "Enabled" : "Disabled"));
        if (c instanceof ComponentContainer) {
            TextField tf = (TextField) ((ComponentContainer) c)
                    .getComponentIterator().next();
            tf.focus();
        }
    }

    class MyBean {
        boolean on = false;
View Full Code Here


    protected void setup() {
        TextField tf1 = new TextField("Tab index 0");
        tf1.setTabIndex(0);
        TextField tf2 = new TextField("Tab index -1, focused initially");
        tf2.setTabIndex(-1);
        tf2.focus();
        addComponent(tf1);
        addComponent(tf2);

        addComponent(createButton(1));
        addComponent(createButton(5));
View Full Code Here

                                    }
                                });
                        form.addComponent(saveButton);

                        event.getButton().getUI().addWindow(w);
                        name.focus();

                        if (tabOrder.getValue()) {
                            name.setTabIndex(5);
                        }
                    }
View Full Code Here

        @SuppressWarnings("unused")
        int nr = 5;
        TextField tf;
        tf = new TextField("TextField (tabIndex 1)");
        tf.setTabIndex(1);
        tf.focus();
        layout.addComponent(tf);
        layout.addComponent(new TextField("TextField without tab index"));
        layout.addComponent(new TextField("TextField without tab index"));
        layout.addComponent(new TextField("TextField without tab index"));
        layout.addComponent(new TextField("TextField without tab index"));
View Full Code Here

        // Textfield for modal window
        final TextField f = new TextField();
        f.setTabIndex(4);
        layout.addComponent(f);
        f.focus();

        // Modal window button
        final Button b = new Button("Test Button in modal window");
        b.setTabIndex(5);
        b.addListener(this);
View Full Code Here

        Button focusButton = new Button("Set focus on TextField");
        focusButton.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                testField.focus();

            }
        });
        addComponent(focusButton);
View Full Code Here

        addComponent(select);
        addComponent(text);
        Button focusText = new Button("Focus text", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                text.focus();
            }
        });
        focusText.setClickShortcut(KeyCode.T, ModifierKey.ALT);

        addComponent(focusText);
View Full Code Here

                            }
                            tfs[idx].setValue("");
                            tfs[idx].setValue(txt.substring(0, 4));
                            if (idx < tfs.length - 1) {
                                TextField next = tfs[idx + 1];
                                next.focus();
                                if (len > 4) {
                                    next.setValue(txt.substring(4, len > 8 ? 8
                                            : len));
                                } else {
                                    next.selectAll();
View Full Code Here

            @Override
            public Component getPopupComponent() {
                VerticalLayout vl = new VerticalLayout();
                TextField field1 = new TextField();
                field1.setValue("one");
                field1.focus();
                vl.addComponent(field1);
                TextField field2 = new TextField();
                field2.setValue("two");
                vl.addComponent(field2);
                vl.setWidth("600px");
View Full Code Here

        // The components added to the window are actually added to the window's
        // layout; you can use either. Alignments are set using the layout
        layout.addComponent(m_closeButton);
        layout.setComponentAlignment(m_closeButton, Alignment.MIDDLE_RIGHT);

        searchField.focus();
    }

    /**
     * Gets the actual text from a named item contained in the given node map.
     *
 
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.