Examples of IdTestLabel


Examples of com.vaadin.tests.widgetset.server.IdTestLabel

    @Override
    protected void setup(VaadinRequest request) {
        getLayout().setSpacing(true);
        getLayout().setMargin(new MarginInfo(true, false, false, false));

        final IdTestLabel idTestLabel = new IdTestLabel("default id");
        idTestLabel.setSizeUndefined();
        addComponent(idTestLabel);

        final IdTestLabel idTestLabelWithId = new IdTestLabel("set id");
        idTestLabelWithId.setSizeUndefined();
        idTestLabelWithId.setId("set10179");
        idTestLabelWithId.setImmediate(true);
        addComponent(idTestLabelWithId);

        final Label label = new Label("no id");
        label.setSizeUndefined();
        addComponent(label);

        Button button = new Button();
        button.setCaption("Toggle");
        button.addClickListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (idTestLabelWithId.getId() == null) {
                    idTestLabelWithId.setId("set10179");
                    idTestLabelWithId.setValue("set id");
                    idTestLabel.setValue("default id");
                    label.setValue("no id");
                } else {
                    idTestLabelWithId.setId(null);
                    idTestLabelWithId.setValue("removed id");
                    idTestLabel.setValue("still default id");
                    label.setValue("still no id");
                }
            }
        });
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.