PDA

View Full Version : Confusion with Radio Buttons



chantc
05-07-2004, 03:52 PM
I have two radio buttons (ButtonA and ButtonB) in one radio group (RBGroup).

I want ButtonA and ButtonB to be associated to one variable (ButtonASelected), and set it to true if ButtonA is selected, and false if ButtonB is selected.

I go into the standard property of ButtonA and associate it with variable ButtonASelected and set it to true. Then I go into the standard property of ButtonB and associate it with variable ButtonASelected and set it to false. When I change the value of ButtonB, it changes the value of ButtonA!

That doesn't seem right at all. Shouldn't a radio group only affect one variable? How did you work around this?

I tried to workaround this by creating to different variables (ButtonASelected and ButtonBSelected). Then I set the standard property for ButtonA to associate with the variable ButtonASelected with a value of true. And, I set ButtonB to associate with the variable ButtonBSelected with a value of true.

But, when I go to another dialog and come back, ButtonB has changed it's value to false! Can I not have two buttons that set to true? It seems like I have to have 1 true, and 1 false, is that correct?

So, would that mean that if I want to see if ButtonA is selected I check for a value of true, and if I want to see if ButtonB is selected I check for a value of false? help!

MarloV
05-13-2004, 02:17 PM
Chanc,

I am not clear as to what you are trying to do, but only one radio button within the same Radio Button Group can be selected/true.

The Dialog Editor Tutorial in the Help Library creates a group of 2 radio buttons, and adds the Swing event required to test them. See if that example helps.