I have a simple radio group that allows the user to choose "Yes" or "No". The GXT samples show how to set the group up but not how to get the selected value. In browsing the API doc, it appears that you should be able to ask the RadioGroup instance for it's value to tell which radio was selected. The method getValue() on RadioGroup returns the selected Radio instance. From that, it also appears that you should be able to ask the Radio instance for it's name. Therefore group.getValue().getName() should be able to give you the name of the selected Radio instance. However, it doesn't. Instead, it gives me the name of the RadioGroup. Why doesn't this work? What is the proper way of getting the selected value of the radio group if this isn't?
Radio noRadio = new Radio();
noRadio.setName("no");
noRadio.setBoxLabel("No");
noRadio.setValue(true);
Radio yesRadio = new Radio();
yesRadio.setName("yes");
yesRadio.setBoxLabel("Yes");
yesRadio.setValue(false);
redundantServerRadioGroup = new RadioGroup("group");
redundantServerRadioGroup.add(noRadio);
redundantServerRadioGroup.add(yesRadio);
redundantServerRadioGroup.setValue(noRadio);
Reply With Quote
