Try calling your setUpMenuBar() method on the MenuBar's creationComplete
event and add menuBarRef.validateNow() after setting the dataProvider
property. validateNow() forces the menuBar to do an invalidation pass,
which calls the MenuBar's commitProperties method which is necessary to
get the data wired up to the MenuBar correctly. 

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of m.frigge
Sent: Wednesday, January 09, 2008 8:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Set menuBar dataProvider per AS

Hi,

I had a working MenuBar until 
I had to change my application
structure. Now I can't bind the 
dataProvider anymore in the menuBar's
mxml tag. 

So I tried something like this...

[Bindable]
private var menuBarCollection:XMLListCollection;

private function setUpMenuBar(event:Event):void{
  menuBarCollection = new XMLListCollection(menubarList);
  menuBarRef.dataProvider = menuBarCollection;
}

The function is called on the MenuBar's
Initialize event and menuBarList is
a XMLList, that was working fine before.

I also tried to use other events as well as 
things like invalidateNow()
after I set the dataProvider, but the 
MenuBar doesn't get any items!? 

Any ideas would be appreciated.

Thanks, Max



--
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