I have a binding problem that seems simple, but I can't figure it out.
Here's the deal:
I have a class that I'm using as my model. It looks like this:
[Bindable]
public class MyModel
{
public var items:Array = new Array();
}
I have a class whose objects populate the array:
[Bindable]
public class MyItem
{
public var name:String;
}
I declare an appModel variable in the MXML (with the appropriate
xmlns:local="*" to make it work):
<local:ChoreAppModel id="appModel"/>
When the app starts up I put a few test items in the array:
var anItem:MyItem = new MyItem();
anItem.name = "Test 1";
appModel.items.push(anItem);
anItem:MyItem = new MyItem();
anItem.name = "Test 2";
appModel.items.push(anItem);
Now, if I create a ComboBox and bind it thusly:
<mx:ComboBox labelField="name"
dataProvider="{appModel.items}"/>
It works: I see Test 1 and Test 2 in my ComboBox. But if I bind it
to a List:
<mx:List dataProvider="{appModel.items}" labelField="name"/>
I see nothing. Funny thing is, if I create a global array and bind
the list to that, it works. So it seems to have something to do with
the fact that the array is a property of appModel.
What am I missing?
Thanks.
--
Steve Tibbett
[EMAIL PROTECTED]
--
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/