Tag name: <amc:menu>

A Menu is a vertical container for menu items. A Menu consists of two main parts - the menu link and the menu container. The menu link is what you click on to open the menu popup. The menu container is the popup that opens when you click on the menu link. The menu container displays the contents of the menu, which are menu items. These items are typically CommandMenuItems, and SubMenus.

A Menu is designed to only hold MenuGroups.

Besides MenuGroup, other types of children are not allowed.

If you use <amc:menuGroup> to group items inside a Menu, the Menu will include separators around the group.

The number of items displayed in a Menu is limited by the target device's screen size. When there are more items than the display limit, scroll up and scroll down icons are displayed for the Menu, allowing the user to scroll through the Menu contents.

There are two different types of Menus, determined by the "type" attribute of the Menu.

Main

Main Menus are shown on the main system menu on each platform. Brining up this Menu is device dependent.

Alt

Alt Menus are shown on the left menu button on Windows Mobile and will act as a main menu on BlackBerry.

WM Menu screenshot
Main menu component running on Windows Mobile.

BB Menu screenshot
Main Menu component running on BlackBerry.
WM Menu screenshot
Alt Menu component running on Windows Mobile.
BB Menu screenshot
Alt Menu component running on BlackBerry.

<amc:menu type="main" id="m1">
    <amc:menuGroup id="g1">
      <amc:subMenu label="Edit" id="sm1">
        <amc:menuGroup id="g2">	  
          <amc:commandMenuItem label="Copy" id="cm1" />
          <amc:commandMenuItem label="Paste" id="cm2" />
        </amc:menuGroup>
      </amc:subMenu>
    </amc:menuGroup>
    <amc:menuGroup id="g3">
      <amc:commandMenuItem label="Open" id="cm3"/>
    </amc:menuGroup>
  </amc:menu>

Attributes

Name Type Supports EL? Description
id String No Specifies the identifier for the component. The identifier must follow the following rules:
  • Must not be a zero-length String.
  • First character must be an ASCII letter (A-Za-z) or an underscore ('_').
  • Subsequent characters must be an ASCII letter or digit (A-Za-z0-9), an underscore ('_'), or a dash ('-').
label String Yes Defines the label of the component.
platform String Yes Specifies the client platform on which this component will appear. Valid values:
  • All (default): the component is rendered on all platforms.
  • Windows Mobile: the component is rendered on Windows Mobile only.
  • BlackBerry: the component is rendered on BlackBerry only.
If the platform is set to "All", Menu Group and Menu Item components that reside inside this menu can have their platform attributes selectively set to "Windows Mobile" or "BlackBerry" to enable their display in either platform.

Note: because Sub Menu is not supported on BlackBerry smartphones, this attribute will be ignored even if it is set to "BlackBerry".
rendered boolean Yes Specifies whether or not the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible).
type String Yes Specifies the type of the menu. Valid values:
  • main (default): the component is rendered on the main menu.
  • alt: the component is rendered as an alternate menu on Windows Mobile and a main menu on BlackBerry.