addMenuItem( title, callback, [isDefault] ) method

This function adds a menu item to the collection.

Syntax

addMenuItem( title, callback, [isDefault] )

Parameters

Name Type Argument Description
title string   The display text for the menu item.
callback anonymous.genericCallbackFunction   The function to call when the menu item is clicked.
isDefault boolean (optional) Determines if the menu item is selected by default on BlackBerry. If more than one menu item is added to the same collection with true for this parameter, the last menu item added with true for this parameter will be selected by default on Blackberry.

Example

var callbackFunctionName = function()
{
   alert( "Menu item clicked!" );
}
var menuItemCollection = new hwc.MenuItemCollection();
menuItemCollection.addMenuItem("menu item name", "callbackFunctionName()", true);

Source

hwc-comms.js, line 575.