Hi all,

I need to enable and disable menu items in dependency of model changing. What are the best practices?

Thanks

 

Now I use something like this but it isn’t good solution when menu depends on many models parameters:

<mx:MenuBar

xmlns:mx=http://www.adobe.com/2006/mxml

labelField="@label"

itemClick="handleMenuBar(event)"

dataProvider="{getMenuBar(models.currentView)}">

<mx:Script>

             <![CDATA[

                    import com.adobe.cairngorm.control.CairngormEventDispatcher;

                    import com.youos.explorer.command.LogoffCommand;

                    import com.youos.explorer.model.Models;

                    import com.youos.explorer.event.LogoffEvent;

                    import mx.collections.XMLListCollection;

 

                    [Bindable]

                    private var models:Models = Models.getInstance();

 

                    private function getMenuBar(... args):XMLListCollection

                    {

                           return new XMLListCollection(new XMLList(<>

                                  <menuItem label="File">

                                        <menuItem label="Logoff"

                                               data="">LogoffEvent.EVENT_LOGOFF}

                                               enabled={LogoffCommand.getEnabled()}/>

                                        </menuItem>

                                  <.menuItem>

                           </>));

}

 

private function handleMenuBar(event:Object):void

{

                           switch ([EMAIL PROTECTED]()) {

                                  case LogoffEvent.EVENT_LOGOFF:

                                        onLogoff();

                                        break;

 

__._,_.___

--
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
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to