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");