1 Reply Latest reply on May 18, 2010 11:25 AM by UbuntuPenguin

    Handling ComboBox Values with different ViewStates

    nIvelyx

      Hello All,

       

      I've noticed that in Flex (using the 3.5 SDK), when you create an application with one or more states, and one of the states has a combobox on it, when you select the combobox item and then move on to the secondary state, the combobox value gets lost when you return to the original state.

       

      To give an example, consider this:

       

      "State A" --> Simply a page with a combobox on it, and a button that says, "Click me for State B"

           - If you select an item from the combobox and then click the button, you go to state B


      "State B" --> Simply a page with a button that says, "Click me for State A"

           - If you click the button, you're taken back to State A

       

      The problem seems to be that State A will lose your combobox value upon returning to that state. A non-elegant (imo) way to handle this is to save the combobox value in a bindable item so that when you return to state A, you can simply "call up" that bindable item and then figure out what should be selected for the combobox.

       

      Is there a better way to handle this? I know checkboxes and such are "persistant", that is, they will stay checked/unchecked on the page no-matter if you go from State A to State B.

       

      Thanks in advance.