2 Replies Latest reply on Sep 11, 2008 12:01 PM by tan73

    State and radiobutton

    tan73
      Hi

      I am a bit new to Flex and encountered this.

      The app is a relativly basic form and the elements is spread out to some states (i do not have a form element as parent, just text fields, check boxes etc.)

      I have a button that resets the form using this for radiobuttons

      myRadioButtonGroup.selection = null;

      But this does not work if I am in a state outside the radio button group.

      I can trace the group, but the crashes when I set selection to null

      Anyone has a solution to this problem, I have tried to figure it out for hours now .)

      thanks in advance,

      regards tan





        • 1. Re: State and radiobutton
          EvolvedDSM Level 2
          Are you removing the radio button group from your app on state change? As in, are you using the same container for all your states and are just removing components and adding new ones for each state?

          Maybe set your reset button to call a function, click="resetForm()"
          create the function
          private function resetForm():void{
          currentState = '<state with your radio buttons>';
          myRadioButtonGroup.selection = null;
          }

          I'm having difficulty visualizing your app. I suppose answer my first question above and post back :)
          • 2. Re: State and radiobutton
            tan73 Level 1
            thanks,

            I have to set the currentState before reseting the radio group.