append()

Description:

Call the append method to add a child menu item to the parent menu item in the options menu list. This results in the creation of a submenu list in the menu tree. Use this method to create a cascading submenu when needed.

Menu items are shown on the options menu list in the order in which they are appended.

Syntax:

[void] MenuItem.append(MenuItem childMenuItem)

Arguments:

  • childMenuItem:

    This is an instance of the MenuItem object which is being added to the parent menu item. See also the menu.append method description for instructions on how to append a menu item to the top level of the options menu list.

Return value:

This method does not return a value.

Remarks:

For devices with a small screen, it is not practical to create multi-level cascading submenus. Thus, a maximum of two-levels is recommended for submenus.

Appending a new menu item fails if it tries to create a duplicate menu item (it either has the same id or the same label as an existing menu item).

For more general information on constructing an options menu, see Using softkeys.

Example code:

See the example code in the description of the MenuItem.onSelect property.