Class sap.ui.core.ItemModule: sap/ui/core/Item

extends Element

A control base type.

Constructor Summary
new sap.ui.core.Item(sId?, mSettings?)Constructor for a new Item.
Method Summary
sap.ui.core.Item.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.Item with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.Item.getMetadata()Returns a metadata object for class sap.ui.core.Item.
getEnabled()Gets current value of property enabled.
getKey()Gets current value of property key.
getText()Gets current value of property text.
getTextDirection()Gets current value of property textDirection.
setEnabled(bEnabled)Sets a new value for property enabled.
setKey(sKey)Sets a new value for property key.
setText(sText)Sets a new value for property text.
setTextDirection(sTextDirection)Sets a new value for property textDirection.
Constructor Detail
new sap.ui.core.Item(sId?, mSettings?)
Constructor for a new Item.

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

In addition, all settings applicable to the base type sap.ui.core.Element can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Method Detail
sap.ui.core.Item.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.Item with name 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.

Parameters:
{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
Returns:
{function} Created class / constructor function
sap.ui.core.Item.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.Item.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
getEnabled(): boolean
Gets current value of property enabled.

Enabled items can be selected.

Default value is true.

Returns:
{boolean} Value of property enabled
getKey(): string
Gets current value of property key.

Can be used as input for subsequent actions.

Returns:
{string} Value of property key
getText(): string
Gets current value of property text.

The text to be displayed for the item.

Default value is .

Returns:
{string} Value of property text
getTextDirection(): sap.ui.core.TextDirection
Gets current value of property textDirection.

Options are RTL and LTR. Alternatively, an item can inherit its text direction from its parent control.

Default value is Inherit.

Returns:
{sap.ui.core.TextDirection} Value of property textDirection
setEnabled(bEnabled): sap.ui.core.Item
Sets a new value for property enabled.

Enabled items can be selected.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
{boolean}bEnabled New value for property enabled
Returns:
{sap.ui.core.Item} Reference to this in order to allow method chaining
setKey(sKey): sap.ui.core.Item
Sets a new value for property key.

Can be used as input for subsequent actions.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
{string}sKey New value for property key
Returns:
{sap.ui.core.Item} Reference to this in order to allow method chaining
setText(sText): sap.ui.core.Item
Sets a new value for property text.

The text to be displayed for the item.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is .

Parameters:
{string}sText New value for property text
Returns:
{sap.ui.core.Item} Reference to this in order to allow method chaining
setTextDirection(sTextDirection): sap.ui.core.Item
Sets a new value for property textDirection.

Options are RTL and LTR. Alternatively, an item can inherit its text direction from its parent control.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Inherit.

Parameters:
{sap.ui.core.TextDirection}sTextDirection New value for property textDirection
Returns:
{sap.ui.core.Item} Reference to this in order to allow method chaining