Abstract Class sap.ui.unified.MenuItemBaseModule: sap/ui/unified/MenuItemBase
Abstract base class for menu item which provides common properties and events for all concrete item implementations.
Since: 1.21.0.
MenuItemBase
for menu item elements.sClassName
and enriches it with the information contained in oClassInfo
.fnFunction
to the select
event of this sap.ui.unified.MenuItemBase
.fnFunction
from the select
event of this sap.ui.unified.MenuItemBase
.MenuItemBase
for menu item elements. Please use concrete subclasses. Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- enabled : boolean (default: true)
- visible : boolean (default: true)
- startsSection : boolean (default: false)
- Aggregations
- submenu : sap.ui.unified.Menu (default)
- Events
- select : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Element can be used as well.
{string} | sId? | Id for the new control, generated automatically if no id is given |
{object} | mSettings? | Initial settings for the new control |
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{sap.ui.unified.MenuItemBase} | oControlEvent.getParameters.item | The current item |
sClassName
and enriches it with the information contained in oClassInfo
. oClassInfo
might contain the same kind of information as described in sap.ui.core.Element.extend.
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
{function} | Created class / constructor function |
{sap.ui.base.Metadata} | Metadata object describing this class |
fnFunction
to the select
event of this sap.ui.unified.MenuItemBase
. When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.ui.unified.MenuItemBase
itself.
Fired when the item is selected by the user. Note: The event is also available for items which have a submenu. In general, applications must not handle event in this case because the user selection opens the sub menu.
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ui.unified.MenuItemBase itself |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
submenu
. {sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
fnFunction
from the select
event of this sap.ui.unified.MenuItemBase
. The passed function and listener object must match the ones used for event registration.
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
select
to attached listeners. Expects the following event parameters:
item
of typesap.ui.unified.MenuItemBase
The current item
{Map} | mArguments? | The arguments to pass along with the event |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
enabled
. When an item is disabled the item can not be selected by the user. The enabled property of the item has no effect when the menu of the item is disabled (Menu#getEnabled).
Default value is true
.
{boolean} | Value of property enabled |
startsSection
. Defines whether a visual separator should be rendered before the item. Note: If an item is invisible also the separator of this item is not shown.
Default value is false
.
{boolean} | Value of property startsSection |
submenu
. An optional submenu of the item which is opened when the item is selected by the user.
{sap.ui.unified.Menu} |
visible
. Invisible items do not appear in the menu.
Default value is true
.
{boolean} | Value of property visible |
Subclasses may override this function.
{boolean} | bHovered | Specifies whether the item is currently hovered or not. |
{sap.ui.unified.Menu} | oMenu | The menu to which this item belongs |
Subclasses may override this function.
Subclasses may override this function.
{boolean} | bOpened | Specifies whether the submenu of the item is opened or closed |
Subclasses may override this function.
{sap.ui.core.RenderManager} | oRenderManager | The RenderManager that can be used for writing to the render-output-buffer |
{sap.ui.unified.MenuItemBase} | oItem | The item which should be rendered |
{sap.ui.unified.Menu} | oMenu | The menu to which this item belongs |
enabled
. When an item is disabled the item can not be selected by the user. The enabled property of the item has no effect when the menu of the item is disabled (Menu#getEnabled).
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bEnabled | New value for property enabled |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
startsSection
. Defines whether a visual separator should be rendered before the item. Note: If an item is invisible also the separator of this item is not shown.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is false
.
{boolean} | bStartsSection | New value for property startsSection |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
submenu
. {sap.ui.unified.Menu} | oSubmenu | The submenu to set |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |
visible
. Invisible items do not appear in the menu.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
{boolean} | bVisible | New value for property visible |
{sap.ui.unified.MenuItemBase} | Reference to this in order to allow method chaining |