Package com.ponysdk.ui.server.basic

Examples of com.ponysdk.ui.server.basic.PRadioButton


        panelTop.add(new PLabel("Select your favorite color:"));

        panelTop.add(newPRadioButton("color", "blue"));
        panelTop.add(newPRadioButton("color", "red"));

        final PRadioButton yellow = newPRadioButton("color", "yellow");
        yellow.setEnabled(false);
        panelTop.add(yellow);

        panelTop.add(newPRadioButton("color", "green"));

        final PVerticalPanel panelBottom = new PVerticalPanel();
View Full Code Here


        examplePanel.setWidget(panel);
    }

    private PRadioButton newPRadioButton(final String name, final String label) {
        final PRadioButton radioButton = new PRadioButton(name, label);
        radioButton.addValueChangeHandler(this);
        return radioButton;
    }
View Full Code Here

        return radioButton;
    }

    @Override
    public void onValueChange(final PValueChangeEvent<Boolean> event) {
        final PRadioButton radioButton = (PRadioButton) event.getSource();
        PNotificationManager.showTrayNotification("Name = " + radioButton.getName() + " Text = " + radioButton.getText() + " Value = " + radioButton.getValue());
    }
View Full Code Here

        formFieldComponent.setCaption(caption);

        fields.add(formFieldComponent);

        for (final String item : items) {
            final PRadioButton radioButton = new PRadioButton(caption, item);
            if (debugID != null) {
                radioButton.ensureDebugId(debugID + "[" + item + "]");
            }

            radioButton.addClickHandler(new PClickHandler() {

                @Override
                public void onClick(PClickEvent event) {
                    selectItem(item);
                }
View Full Code Here

        this.debugID = id;
    }

    public void addItem(final String item) {
        for (final FormFieldComponent<PVerticalPanel> field : fields) {
            final PRadioButton radioButton = new PRadioButton(caption, item);
            field.getInput().add(radioButton);
        }
        items.add(item);
    }
View Full Code Here

        items.add(item);
    }

    public void addItem(final String item, Object hiddenValue) {
        for (final FormFieldComponent<PVerticalPanel> field : fields) {
            final PRadioButton radioButton = new PRadioButton(caption, item);
            field.getInput().add(radioButton);
        }
        items.add(item);
        hiddenValueByItems.put(item, hiddenValue);
        itemsByHiddenValue.put(hiddenValue, item);
View Full Code Here

        updateUI(new RequestHandler() {

            @SuppressWarnings("unchecked")
            @Override
            public void onRequest() {
                final PRadioButton radio1 = new PRadioButton("group1", "Text 1");
                radio1.ensureDebugId("radio1");
                final PRadioButton radio2 = new PRadioButton("group1", "Text 2");
                radio2.ensureDebugId("radio2");
                final PRadioButton radio3 = new PRadioButton("group1", "Text 3");
                radio3.ensureDebugId("radio3");
                PRootPanel.get().add(radio1);
                PRootPanel.get().add(radio2);
                PRootPanel.get().add(radio3);

                radio1.addValueChangeHandler(eventsListener);
                radio2.addValueChangeHandler(eventsListener);
                radio3.addValueChangeHandler(eventsListener);

                register(radio1);
                register(radio2);
                register(radio3);
            }
        });

        final WebElement label1 = findElementById("radio1-label");
        final PRadioButton radio1 = get("radio1");
        Assert.assertEquals("Text 1", label1.getText());
        Assert.assertEquals("Text 1", radio1.getText());

        // select item
        updateUI(new RequestHandler() {

            @Override
            public void onRequest() {
                final PRadioButton radio1 = get("radio1");
                radio1.setValue(true);
            }
        });

        final WebElement input1 = findElementById("radio1-input");
        final WebElement input2 = findElementById("radio2-input");
View Full Code Here

TOP

Related Classes of com.ponysdk.ui.server.basic.PRadioButton

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.