2 Replies Latest reply on Sep 2, 2008 6:47 PM by riesvantwisk

    remember selected item with ComboBox

    riesvantwisk Level 1
      Hey All,

      I was just wondering how other pople solve this issue.

      I have a combobox with a XX number of items in there. Now when I re-populate the combobox the selected item get's lost. I also would like to remember the selected item during sessions. For instance when A user selected item XX on monday. I would like to have it automatically set XX again when a user comes back on tuesday.

      Is there a meganism in adobe flex that allows me to remember a 'state' of a object, or is that custom programming?
      Ideally I would like to have a component that can do teh work for me rather then my application handles the logic, some sort of a state manager?

      Ries

        • 1. Re: remember selected item with ComboBox
          Gregory Lafrance Level 6
          Use a SharedObject, and write to it in the ComboBox change handler. See SharedObject in FB3 help sys.
          • 2. Re: remember selected item with ComboBox
            riesvantwisk Level 1
            hey Greg,

            I decided to create my own 'State Manager' (not flex states) and will override all components I need to have a state with.
            In my case states need to be stored on the sever for each user account (I am using blaze-ds)

            So currently my components look much like this:

            <ns1:ComboboxStated x="150" y="253" id="ries" dataProvider="{testarray}" stateManager="{statemanager}" />

            <ns1:StateManager id="statemanager" stateId="state_edintifier"/>


            As soon as ComboboxStated initializes it will request the state manager it's last state and will set the slectedItem to the last selected item the user did (if available in the current data array).

            thanks for your input,
            Ries van Twisk