2 Replies Latest reply on Dec 2, 2007 8:41 PM by doug777

    RadioButtonGroup Not In Tab Order

    AwesomeDigital3 Level 1
      I am working on a registration form with one of the items being a gender radio button group.

      For some reason, unless one of them is selected first, you can not tab to them from the previous field.

      Once one is selected, or if I mark one Selected="true", the tab key works as expected.

      Has anyone else run into this problem, or can anyone suggest a hack?

      Thanks
      Mathias

      <mx:FormItem label="Gender" required="true" >
      <mx:HBox horizontalGap="-2">
      <mx:RadioButtonGroup id="gender" />
      <mx:RadioButton id="femaleRadio" groupName="gender" label="Male" data="Male" />
      <mx:RadioButton id="maleRadio" groupName="gender" label="Female" data="Female"/>
      </mx:HBox>
      </mx:FormItem>
        • 1. Re: RadioButtonGroup Not In Tab Order
          AwesomeDigital3 Level 1
          I've been playing with this a bit, perhaps somebody could tell me what is going on here?

          If none of the radio buttons in the group is selected when the forms is first shown, the entire group item seems to be non-existent. If I try to see what the value is, I get the error below. I think that is why the focus is not going there?

          trace(gender.selectedValue);
          Error #1009: Cannot access a property or method of a null object reference.

          Can anyone think of a way to make the Radion button group NOT be a null object without having one of the items pre-selected?

          I thought I might try setting one radio buttons to true then false right after that in the show event method of the form, but that does not work. The radio button group is still a null object

          Thanks
          Mathias




          <mx:FormItem label="Gender" required="true" >
          <mx:HBox horizontalGap="-2">
          <mx:RadioButtonGroup id="gender" />
          <mx:RadioButton id="maleRadio" groupName="gender" label="Male" data="Male" />
          <mx:RadioButton id="femaleRadio" groupName="gender" label="Female" data="Female"/>
          </mx:HBox>
          </mx:FormItem> }
          • 2. Re: RadioButtonGroup Not In Tab Order
            doug777 Level 1
            You have to use callLater(myFunc) when you set the last RadioButton, and then you can use the selectedIndex inside myFunc.