What am I doing wrong for a LinkBar

View: New views
3 Messages — Rating Filter:   Alert me  

What am I doing wrong for a LinkBar

by Kim Hoopingarner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've posted a very simple program below.  And it doesn't work as I thought it should.  Simply - I want to be able to bind a dynamic array to the link bar.  When I run this - I got the linkbar with no TEST 1 showing.  I'm sure this is a silly problem - 101, right?

Thanks for your advice!

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();">
 
<mx:Script>
        <![CDATA[
                [Bindable] private var aLanguage:Array = new Array();
               
                private function init():void{
                        aLanguage.push("Test 1");
                }
        ]]>
</mx:Script>
       
<mx:Canvas>
        <mx:LinkBar id="tbbLanguage" dataProvider="{aLanguage}" width="294" color="#ffffff" backgroundColor="#000000"/>
</mx:Canvas>

</mx:Application>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5859
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.37

Re: What am I doing wrong for a LinkBar

by Barney Boisvert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The issue is that Array objects aren't don't trigger binding execution
when they are changed.  You'll need to use an ArrayCollection instead
(or trigger the binding execution manually).

cheers,
barneyb

On Wed, Apr 8, 2009 at 10:31 AM, Kim Hoopingarner
<k.hoopingarner@...> wrote:

>
> I've posted a very simple program below.  And it doesn't work as I thought it should.  Simply - I want to be able to bind a dynamic array to the link bar.  When I run this - I got the linkbar with no TEST 1 showing.  I'm sure this is a silly problem - 101, right?
>
> Thanks for your advice!
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init();">
>
> <mx:Script>
>        <![CDATA[
>                [Bindable] private var aLanguage:Array = new Array();
>
>                private function init():void{
>                        aLanguage.push("Test 1");
>                }
>        ]]>
> </mx:Script>
>
> <mx:Canvas>
>        <mx:LinkBar id="tbbLanguage" dataProvider="{aLanguage}" width="294" color="#ffffff" backgroundColor="#000000"/>
> </mx:Canvas>
>
> </mx:Application>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5860
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.37

Re: What am I doing wrong for a LinkBar

by Kim Hoopingarner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks!  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5861
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.37