PDA

View Full Version : RadioGroup listener - how can I determine which Radio button was selected?



alexworden
24 Aug 2010, 12:39 PM
Hi,

I've searched the docs and the forums but can't figure this one out. Can someone provide an example of how I can retrieve the fieldname of the selected radio button from a RadioGroup. Here's my code so far:



radioGroup.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent fe) {
if (((Boolean)fe.getValue()) == true) {
// How do I determine which radio button was selected?
}
}
});


Thanks!

Alex

sven
24 Aug 2010, 12:44 PM
radioGroup.getValue() will return you the currently selected radio.