Menu

Introduction

The Menu control represents a popup menu. A popup menu opens in front of the application and allows the user to select one of the shown actions which are implemented in the form of menu items.

Example

The example shows a two-level menu which can be opened by clicking a link. To position the menu, the sap.ui.core.Popup functionality is used. The Menu can either be used stand alone like in this example, or as part of other controls like MenuBar or MenuButton. A menu accepts items of type sap.ui.commons.MenuItemBase which is the base type of all menu items. Current implementation: sap.ui.commons.MenuItem.

Alternatively to registering an event handler on every menu item, it is also possible to use a single event handler which is attached to the itemSelect event of the root menu; this is shown in the next example.

Keyboard Support

It is possible to navigate through the items of a menu using the Arrow up and Arrow down keys step by step; using the keys Pos1 and End, you can directly jump to the first or the last item. The Arrow left and Arrow right keys are available for opening and closing sub-menus, if they exist. Escape closes the current menu. Using the Space or Enter key, items can be selected.

ARIA Support

The Menu control supports ARIA. The necessary ARIA properties are generated automatically according to the structure of the menu. Via the control property ariaDescription it is additionally possible to define a descriptive label for a menu.

API Documentation

See API documentation