Hi,

The following is basically what I did.

in <mx:script> tag

Declare an array object:
     var myArr :Array = ['one','two','three']; //I did NOT use
[Bindable] here

Bind array object directly to a combo box:

    <mx:ComboBox id="cb1" rowCount="10" dataProvider="{myArr}" />   

Bind the dataprovider of the cb1 to another comboBox:

    <mx:ComboBox id="cb2" rowCount="10" dataProvider="{ cb1.
dataProvider }" />

Use a textInput control to update the second element of the array:
    <mx:TextInput id="sText" change="myArr[1]= sText.text " />


Result:

  when I put some text into textinput box, both combobox dropdown
list changes.

In Flex 2 documentation "Using collection change notifications", it
said
   "Specifying [Bindable] metadata before a variable declaration   
   causes the object represented by the variable to implement the
   IPropertyChangeNotifier interface."

I was wondering if this is somehow related or not.

Thanks,

Larry



--- In [email protected], "Gordon Smith" <[EMAIL PROTECTED]> wrote:
>
> What kind of change did you make to the array object? If you
assigned
> another array to dataProvider, I'd expect the ComboBox to update.
If you
> did
>
>     myDataProvider[0] = newItem;
>
> or
>
>     myDataProvider.splice(3, 1);
>
> I wouldn't.
>
> - Gordon
>
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
com] On
> Behalf Of Larry Liang
> Sent: Wednesday, April 26, 2006 1:10 AM
> To: [email protected]
> Subject: [flexcoders] Binding with arrays in Flex 2 beta 2
>
>
> According to documentation, in Flex 1.5, you shouldn't bind your
> dataprovider to a raw array object, because array elements do not
> broadcast [ChangeEvent]. And therefore the flex controls won't
update
> itself and refelct the changes.
>
> I just tried to bind an array object to a comboBox dataprovider in
> Flex 2. And it seemed that the changes made to the array object did
> get updated in the combo box control.
>
> I was wondering if this has been fixed in flex 2 purposly, or due
to
> some other reasons.
>
> Thanks,
>
> Larry
>

>
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.
txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to