Provide Data for Menus : Menu Model « Components « Flex






Provide Data for Menus

Provide Data for Menus
      

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">

    <mx:MenuBar labelField="@label">
        <mx:XMLList>
            <menuitem label="File">
                <menuitem label="New"/>
                <menuitem label="Open"/>
                <menuitem label="Close" enabled="false"/>
            </menuitem>
            <menuitem label="Edit"/>
            <menuitem label="Source"/>
            <menuitem label="View">
                <menuitem label="50%" type="radio" groupName="one"/>
                <menuitem label="100%" type="radio" groupName="one" selected="true"/>
                <menuitem label="150%" type="radio" groupName="one"/>
            </menuitem>
        </mx:XMLList>
    </mx:MenuBar>
</mx:Application>
    
    

   
    
    
    
    
    
  








Related examples in the same category

1.Create a Menu that uses an Array data providerCreate a Menu that uses an Array data provider
2.Use to define the data for the Menu controlUse <mx:XML> to define the data for the Menu control
3.Use XMLListCollection as the data model for MenuBarUse XMLListCollection as the data model for MenuBar
4.Array DataProvider for MenuArray DataProvider for Menu
5.An XML menu data provider with iconsAn XML menu data provider with icons
6.The dataProvider property is the default property of the MenuBar controlThe dataProvider property is the default property of the MenuBar control
7.Create MenuBar from XMLListCreate MenuBar from XMLList
8.Create menu from XMLCreate menu from XML
9.Create Menu from ArrayCreate Menu from Array
10.Define XML or XMLList object as a direct child of the Define XML or XMLList object as a direct child of the <mx:MenuBar>
11.Dynamically Populate MenusDynamically Populate Menus
12.Model With MenuModel With Menu