Have you tried:

enabled="{bindableProp !=null?true:false}"


On Wed, Nov 5, 2008 at 7:17 PM, Mark Carter <[EMAIL PROTECTED]> wrote:

>
> <mx:MenuBar id="myMenuBar">
> <mx:XMLList>
> <!--DOES NOT WORK!!! menuitem label="Action" enabled="{bindableProp !=
> null}"/-->
> <menuitem label="Action" enabled="{myMenuBar != null &amp;&amp;
> bindableProp != null}"/>
> </mx:XMLList>
> </mx:MenuBar>
>
> This allows me to disable the menuitem when bindableProp is null.
>
> In the above example, bindableProp is a Boolean which has been declared as
> Bindable. When the container is created, this bindableProp is null. Later,
> I
> set it to something non-null.
>
> The above code works fine. However, its a workaround, because if I don't
> include the "myMenuBar != null &amp;&amp;" part, then the menuitem is
> initially enabled (before the bindableProp has been set to a non-null
> value).
>
> On closer inspection "myMenuBar" can be replaces with any other non-null
> Bindable property, and it still works. Null properties or non-bindable
> properties do not work there.
>
> Also its ok to do something like: "{nonNullBindableProp.nullBindableProp !=
> null}" but NOT "{nullBindableProp != null}"
>
> Is this a bug or am I doing something wrong?
> --
> View this message in context:
> http://www.nabble.com/MenuBar-menuitem-data-binding-bug--tp20343455p20343455.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],

Reply via email to