9 Replies Latest reply on Jan 5, 2010 10:48 AM by WebTrauma

    DropDownList: Set selectedIndex and @{databinding}...asynchonous?

    WebTrauma Level 1

      I am calling a component from my main Flex app.

       

      This component contains a DropDownList (dDL).

       

      I am sending bi-directionally bound number from my main app's valueObject to the component.

       

      Populating the dDL from an array collection is easy...I call a function from the component's creationComplete.

       

      The bi-directional data binding works great...I see my valueObject being updated when a different value is selected from the dDL.

       

      In the component, upon initialization I use an iterator to find the array index value that matches the passed-in number. Therefore, the dDL value displayed matches what is passed in from the valueObject. So far, so good.

       

      This works only when I do NOT use bi-directional data binding (e.g. passing in a literal from the main app to the component).

       

      I think what might be happening is some asynchonous behavior caused by bi-directional data binding? In the component, I don't think the value returns from the @ databinding function in time to be used for component initialization.

       

      What event should I be using to set the 'prompt' in the dDL to make sure the databinding function has returned & thus my data from the main app is available?

       

      Thanks!