11-16-2012 06:21 AM
I am trying to make a Customized RadioButton Control.But i am getting this error "Displayed Radio Button is not a member of a group"
11-16-2012 06:37 AM
And have you added the RadioButton - even your customized one - to a group?
As I understand it, RadioButtons do not exist on their own, they must be added to group. This from the API doc:
"Before you can use the newly built readio button field, you must add it to a valid radio button group."
If you want a simple 'switchable' property, then look at customizing the CheckboxField.
Or look at the sample here:
11-16-2012 07:27 AM
That issue is being fixed,what i am doing is I am sending the instance of RadioButtonGroup to the CustomRadioField class and passing it to super
In the super i am doing
public RadioControl(int width, int height,String text,RadioButtonGroup rbg) {
super(text, rbg, false);
mWidth = width;
mHeight = height;
rbg.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
//valueOfRadioButton = rbGroup.getSelectedIndex();
}
});
}And from my caller class i am setting the listener
radioControl.setChangeListener(this);
and adding the radio control to my manager.I am able to display the radio buttons nw,bt the problem is that if i select all the three radio buttons each radio button field remains in the selected state,where as the actual behaiviour of radio button is if i select one the other should be in unselected state.So whats the problem here?
11-16-2012 08:15 AM
Maybe just me, but I thought you had to reset the RadioButtons when one was selected - assuming that they are mutually exclusive. You will do that in your change listener.