!--a11y-->
Web
Dynpro Menu API – IWDMenu 
The menu element is a subelement of the Tray UI element. It can be used to execute actions in the tray UI element. In this way, it offers an additional for the application in the tray. Each tray can contain one menu UI element only. However, a menu element can contain any number of menu items (MenuItem objects). You cannot use submenus.
The menu element is not a standalone UI element. It can only be used within a tray UI element, as the following screenshot shows.

Method Name |
Parameter |
Return Value |
Short Description |
addItem |
(IWDMenuItem item) |
|
Adds an item element to the end of the item elements list. |
addItem |
(IWDMenuItem item, int index) |
|
Adds an item element to the item elements list at the specified index position. |
destroyAllItems |
|
|
Removes all item elements. These are destroyed and no longer exist, so that the associated IDs can be used for new elements. |
getItems |
|
IWDMenuItem[] |
Returns an array of item elements. |
hasItems |
|
boolean |
Checks whether item elements exist in this menu element. |
iterateItems |
|
Iterator |
Returns an iterator over all the item elements in this menu element. |
numberOfItems |
|
int |
Returns the number of the item elements. |
removeAllItems |
|
|
Removes all item elements. These are retained, and can later be added to this menu element. |
removeItem |
int index |
IWDMenuItem |
Removes the item element at the specified index position. |
removeItem |
String id |
IWDMenuItem |
Removes the item element with the specified ID. |
Additional methods described in the following APIs are available using inheritance: IWDViewElement.

For detailed documentation of all inherited methods, see the documentation for the relevant APIs.
