Constructor

Syntax:

[MenuItem] new MenuItem(String label, Integer id)

Description:

The new operator creates and instantiates an instance of the MenuItem object.

Arguments:

Return value:

An initialized instance of the MenuItem object.

Remarks:

If the arguments are not valid, a JavaScript exception indicating the error type is thrown. A valid argument implies an integer type for id and a string type for label. The string length for the label is truncated to 40 characters if it exceeds that limit.

Menu items on the whole menu tree are unique and identified by their id.

Example code:

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