MenuItem
The MenuItem object represents a menu item for the screen.
Code Example:
|
Learning Resources:
Sample - Menu Items Example that demonstrates how to use the Menu API to create a custom application menu in a BlackBerry WebWorks application [BlackBerry Developer Resource Center]. |
Supported Platform(s)
- BlackBerry OS 5.0+ |
- Ripple Emulator |
API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
caption | Y | Y | Y | Y | |||
isDefault | Y | Y | Y | Y | |||
isSeparator | Y | Y | Y | Y | |||
ordinal | Y | Y | Y | Y |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
You must declare the feature element(s) below in your configuration document: |
Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
<feature id="blackberry.ui.menu" /> | Y | Y | Y | Y |
Permission Elements (PlayBook and BlackBerry 10+) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Properties
String | caption |
Boolean | isDefault |
Boolean | isSeparator |
Number | ordinal |
Properties
String
caption
Contains the caption for the menu item.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
readonly
Boolean
isDefault
Value is true if the menu item is marked as the default item to be selected in the menu.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
readonly
Boolean
isSeparator
Value is true if the menu item is a separator.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Number
ordinal
Each MenuItem has an ordinal specifying the sort order within the menu. MenuItems with a lower ordinal will have higher positions on the menu than the MenuItems with higher ordinal. A separator will be automatically inserted between adjacent items whose ordinals differ by at least 0x00010000.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |