GWT - GXT - How to get Radio Button Value ?

Create radio

Radio radio = new Radio();
radio
.setBoxLabel("Si");
radio
.setValue(true);
radio
.setValueAttribute("true");

Radio radio2 = new Radio();
radio2
.setBoxLabel("No");
radio2
.setValueAttribute("false");

RadioGroup radioGroup = new RadioGroup();
radioGroup
.setFieldLabel("Afecto");
radioGroup
.add(radio);
radioGroup
.add(radio2);

get selected value

Boolean b = Boolean.parseBoolean(radioGroup.getValue().getValueAttribute());

你可能感兴趣的:(gwt)