Re: [flexcoders] Set menuBar dataProvider per AS
my bad. The component was already created at the time where I assigned the eventListener. I shouldn't develop late at night :-) Sorry for bothering and thanks anyway! Cheers, Max - Original Message From: Deepa Subramaniam <[EMAIL PROTECTED]> To: flexcoders@yahoogroups.com Sent: Thursday, January 10, 2008 10:13:39 AM Subject: RE: [flexcoders] Set menuBar dataProvider per AS Try calling your setUpMenuBar( ) method on the MenuBar's creationComplete event and add menuBarRef.validate Now() 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: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of m.frigge Sent: Wednesday, January 09, 2008 8:56 AM To: [EMAIL PROTECTED] ups.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: XMLListCollectio n; private function setUpMenuBar( event:Event) :void{ menuBarCollection = new XMLListCollection( menubarList) ; menuBarRef.dataProv ider = 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/flexcoder sFAQ.txt Search Archives: http://www.mail- archive.com/ flexcoders% 40yahoogroups. com Yahoo! Groups Links Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
RE: [flexcoders] Set menuBar dataProvider per AS
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
[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