Class sap.m.ListItemBaseModule: sap/m/ListItemBase

extends Control

ListItemBase contains the base features of all specific list items.
Constructor Summary
new sap.m.ListItemBase(sId?, mSettings?)Constructor for a new ListItemBase.
Field Summary
isSelectedReturns the state of the item selection as a boolean
Event Summary
detailPress(oControlEvent)Fires when the user clicks on the detail button of the control.
press(oControlEvent)Fires when the user clicks on the control.
detailTap(oControlEvent)Fires when the user taps on the detail button of the control.
tap(oControlEvent)Fires when the user taps on the control.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.ListItemBase.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.ListItemBase with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.ListItemBase.getMetadata()Returns a metadata object for class sap.m.ListItemBase.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
attachDetailPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the detailPress event of this sap.m.ListItemBase.
attachPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the press event of this sap.m.ListItemBase.
detachDetailPress(fnFunction, oListener)Detaches event handler fnFunction from the detailPress event of this sap.m.ListItemBase.
detachPress(fnFunction, oListener)Detaches event handler fnFunction from the press event of this sap.m.ListItemBase.
fireDetailPress(mParameters?)Fires event detailPress to attached listeners.
firePress(mParameters?)Fires event press to attached listeners.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getCounter()Gets current value of property counter.
getHighlight()Gets current value of property highlight.
getMode()Returns the accessibility announcement for the content Hook for the subclasses.
getSelected()Gets current value of property selected.
getTabbables()Returns the tabbable DOM elements as a jQuery collection
getType()Gets current value of property type.
getUnread()Gets current value of property unread.
getVisible()Gets current value of property visible.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
setCounter(iCounter)Sets a new value for property counter.
setHighlight(sHighlight)Sets a new value for property highlight.
setSelected(bSelected)Sets a new value for property selected.
setType(sType)Sets a new value for property type.
setUnread(bUnread)Sets a new value for property unread.
setVisible(bVisible)Sets a new value for property visible.
attachDetailTap(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the detailTap event of this sap.m.ListItemBase.
attachTap(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the tap event of this sap.m.ListItemBase.
detachDetailTap(fnFunction, oListener)Detaches event handler fnFunction from the detailTap event of this sap.m.ListItemBase.
detachTap(fnFunction, oListener)Detaches event handler fnFunction from the tap event of this sap.m.ListItemBase.
fireDetailTap(mParameters?)Fires event detailTap to attached listeners.
fireTap(mParameters?)Fires event tap to attached listeners.
Constructor Detail
new sap.m.ListItemBase(sId?, mSettings?)

Constructor for a new ListItemBase.

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

    • type : sap.m.ListType (default: Inactive)
    • visible : boolean (default: true)
    • unread : boolean (default: false)
    • selected : boolean (default: false)
    • counter : int
    • highlight : sap.ui.core.MessageType (default: None)

  • Associations

  • Events

    • tap : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • detailTap : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • detailPress : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

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

Parameters:
stringsId?Id for the new control, generated automatically if no id is given
objectmSettings?Initial settings for the new control
Field Detail
isSelected
Returns the state of the item selection as a boolean
Deprecated API:
Since version 1.10.2. API Change makes this method unnecessary. Use getSelected method instead.
Event Detail
detailPress(oControlEvent)
Fires when the user clicks on the detail button of the control.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
press(oControlEvent)
Fires when the user clicks on the control. Note: This event is not fired when the parent mode is SingleSelectMaster or when the includeItemInSelection property is set to true. If there is an interactive element that handles its own press event then the list item's press event is not fired. Also see sap.m.ListBase#attachItemPress.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
detailTap(oControlEvent)
Fires when the user taps on the detail button of the control.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
Deprecated API:
Since version 1.20.0. Instead, use detailPress event.
tap(oControlEvent)
Fires when the user taps on the control.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
Deprecated API:
Since version 1.20.0. Instead, use press event.
Method Detail
sap.m.ListItemBase.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.m.ListItemBase 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.Control.extend.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.m.ListItemBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.ListItemBase.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.m.ListItemBase
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledBythe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Since:
1.28.0
attachDetailPress(oData?, fnFunction, oListener?): sap.m.ListItemBase

Attaches event handler fnFunction to the detailPress event of this sap.m.ListItemBase.

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.m.ListItemBase itself.

Fires when the user clicks on the detail button of the control.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.ListItemBase itself
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
attachPress(oData?, fnFunction, oListener?): sap.m.ListItemBase

Attaches event handler fnFunction to the press event of this sap.m.ListItemBase.

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.m.ListItemBase itself.

Fires when the user clicks on the control. Note: This event is not fired when the parent mode is SingleSelectMaster or when the includeItemInSelection property is set to true. If there is an interactive element that handles its own press event then the list item's press event is not fired. Also see sap.m.ListBase#attachItemPress.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.ListItemBase itself
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
detachDetailPress(fnFunction, oListener): sap.m.ListItemBase

Detaches event handler fnFunction from the detailPress event of this sap.m.ListItemBase.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
detachPress(fnFunction, oListener): sap.m.ListItemBase

Detaches event handler fnFunction from the press event of this sap.m.ListItemBase.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
fireDetailPress(mParameters?): sap.m.ListItemBase
Fires event detailPress to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
firePress(mParameters?): sap.m.ListItemBase
Fires event press to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
Since:
1.28.0
getCounter(): int

Gets current value of property counter.

Defines the counter value of the list items.

Returns:
intValue of property counter
getHighlight(): sap.ui.core.MessageType

Gets current value of property highlight.

Defines the highlight state of the list items.

Default value is None.

Returns:
sap.ui.core.MessageTypeValue of property highlight
Since:
1.44.0
getMode(): string
Returns the accessibility announcement for the content Hook for the subclasses.
Returns:
string
getSelected(): boolean

Gets current value of property selected.

Defines the selected state of the list items. Note: Binding the selected property in single selection modes may cause unwanted results if you have more than one selected items in your binding.

Default value is false.

Returns:
booleanValue of property selected
getTabbables(): jQuery
Returns the tabbable DOM elements as a jQuery collection
Returns:
jQueryjQuery object
Since:
1.26
getType(): sap.m.ListType

Gets current value of property type.

Defines the visual indication and behavior of the list items, e.g. Active, Navigation, Detail.

Default value is Inactive.

Returns:
sap.m.ListTypeValue of property type
getUnread(): boolean

Gets current value of property unread.

Activates the unread indicator for the list item, if set to true. Note: This flag is ignored when the showUnread property of the parent is set to false.

Default value is false.

Returns:
booleanValue of property unread
getVisible(): boolean

Gets current value of property visible.

Whether the control should be visible on the screen. If set to false, a placeholder is rendered instead of the real control.

Default value is true.

Returns:
booleanValue of property visible
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
Since:
1.28.0
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null
Since:
1.28.0
setCounter(iCounter): sap.m.ListItemBase

Sets a new value for property counter.

Defines the counter value of the list items.

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

Parameters:
intiCounterNew value for property counter
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
setHighlight(sHighlight): sap.m.ListItemBase

Sets a new value for property highlight.

Defines the highlight state of the list items.

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

Default value is None.

Parameters:
sap.ui.core.MessageTypesHighlightNew value for property highlight
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Since:
1.44.0
setSelected(bSelected): sap.m.ListItemBase

Sets a new value for property selected.

Defines the selected state of the list items. Note: Binding the selected property in single selection modes may cause unwanted results if you have more than one selected items in your binding.

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

Default value is false.

Parameters:
booleanbSelectedNew value for property selected
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
setType(sType): sap.m.ListItemBase

Sets a new value for property type.

Defines the visual indication and behavior of the list items, e.g. Active, Navigation, Detail.

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

Default value is Inactive.

Parameters:
sap.m.ListTypesTypeNew value for property type
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
setUnread(bUnread): sap.m.ListItemBase

Sets a new value for property unread.

Activates the unread indicator for the list item, if set to true. Note: This flag is ignored when the showUnread property of the parent is set to false.

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

Default value is false.

Parameters:
booleanbUnreadNew value for property unread
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
setVisible(bVisible): sap.m.ListItemBase

Sets a new value for property visible.

Whether the control should be visible on the screen. If set to false, a placeholder is rendered instead of the real control.

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

Default value is true.

Parameters:
booleanbVisibleNew value for property visible
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
attachDetailTap(oData?, fnFunction, oListener?): sap.m.ListItemBase

Attaches event handler fnFunction to the detailTap event of this sap.m.ListItemBase.

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.m.ListItemBase itself.

Fires when the user taps on the detail button of the control.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.ListItemBase itself
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Deprecated API:
Since version 1.20.0. Instead, use detailPress event.
attachTap(oData?, fnFunction, oListener?): sap.m.ListItemBase

Attaches event handler fnFunction to the tap event of this sap.m.ListItemBase.

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.m.ListItemBase itself.

Fires when the user taps on the control.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.ListItemBase itself
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Deprecated API:
Since version 1.20.0. Instead, use press event.
detachDetailTap(fnFunction, oListener): sap.m.ListItemBase

Detaches event handler fnFunction from the detailTap event of this sap.m.ListItemBase.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Deprecated API:
Since version 1.20.0. Instead, use detailPress event.
detachTap(fnFunction, oListener): sap.m.ListItemBase

Detaches event handler fnFunction from the tap event of this sap.m.ListItemBase.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Deprecated API:
Since version 1.20.0. Instead, use press event.
fireDetailTap(mParameters?): sap.m.ListItemBase
Fires event detailTap to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Deprecated API:
Since version 1.20.0. Instead, use detailPress event.
fireTap(mParameters?): sap.m.ListItemBase
Fires event tap to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.m.ListItemBaseReference to this in order to allow method chaining
Deprecated API:
Since version 1.20.0. Instead, use press event.