<menuItem label="New" enabled="' +
{ ModelLocator.getInstance().ACTION_ENABLED_FILE_NEW }
+ '"/>
--- In flexcoders@yahoogroups.com, "Graham Weldon"
<[EMAIL PROTECTED]> wrote:
>
> I've asked this question previously, but in a slightly different
> manner, and since its post, I ahve managed to make some progress.
>
> I have created a new MXML component that represents a MenuBar with
> some items within that will not change except for their enabled
value.
> I am building this on top of the Cairngorm framework 2.0 beta,
which
> means I'm taking advantage of the ModelLocator construct.
>
> I have a collection of ENABLED indicators stored on the
ModelLocator,
> which will be changed at varying points in the programs execution.
> These states need to enable and disable the options in the menu.
>
> Here is a snippet of what I am using, which works great for
indicating
> the initial required enabled or disabled state, but does not
update as
> the variables change...
>
> Any thoughts on how to restructure this to allow the options to
update
> in real time with data binding, rather than being set upon
> instantiation and initialisation of the component.
>
> Thanks in advance!
>
> Regards,
> Graham Weldon
>
>
> ==============================================
>
> import mx.collections.XMLListCollection;
>
> [Bindable]
> private var menuXML : XMLListCollection = new
> XMLListCollection(rawMenuXML);
> [Bindable]
> private var rawMenuXML : XMLList = XMLList(
> '<menuItem label="File" enabled="' +
> ModelLocator.getInstance().ACTION_ENABLED_FILEMENU + '">' +
>
> '<menuItem label="New" enabled="' +
> ModelLocator.getInstance().ACTION_ENABLED_FILE_NEW
+ '"/>' +
> '<meunItem label="Open" enabled="' +
> ModelLocator.getInstance().ACTION_ENABLED_FILE_OPEN
+ '"/>' +
>
> '</menuItem>'
> );
>
>
>
> <mx:MenuBar
> labelField="@label"
> xmlns:mx="http://www.adobe.com/2006/mxml"
> dataProvider="{menuXML}"/>
>
> ==============================================
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.