I have following code:
final Radio trDelRadio = new Radio();
trDelRadio.setName("TDRADIO");
trDelRadio.setBoxLabel("Training");
final Radio cdcRadio = new Radio();
cdcRadio.setName("CDCRADIO");
cdcRadio.setBoxLabel("Content");
final Radio msRadio = new Radio();
msRadio.setName("MSRADIO");
msRadio.setBoxLabel("Management");
final Radio osRadio = new Radio();
osRadio.setName("OSRADIO");
osRadio.setBoxLabel("Outsourcing");
final RadioGroup radioGroup = new RadioGroup();
radioGroup.setOrientation(Orientation.VERTICAL);
radioGroup.add(trDelRadio);
radioGroup.add(cdcRadio);
radioGroup.add(msRadio);
radioGroup.add(osRadio);
radioGroup.addListener(Events.Change, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
GWT.log("Service type: " + radioGroup.getValue().getBoxLabel(), null);
}
});
In this code I'm using GXT 2.0.1 create four radio buttons and then combining them into the radio button group.
Line
GWT.log("Service type: " + radioGroup.getValue().getBoxLabel(), null);
is retrieving Label of selected check box and works fine, but when I'm trying to get name or any other information it's getting value of the RadioGroup. What am I doing wrong here? How do I get selected radio button in RadioGroup?