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(mArguments?)Fires event detailPress to attached listeners.
firePress(mArguments?)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.
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.
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(mArguments?)Fires event detailTap to attached listeners.
fireTap(mArguments?)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
  • 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:
{string}sId? Id for the new control, generated automatically if no id is given
{object}mSettings? Initial settings for the new control
Field Detail
isSelected
Returns the state of the item selection as a boolean
Deprecated:
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.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.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.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
detailTap(oControlEvent)
Fires when the user taps on the detail button of the control.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Deprecated:
Since version 1.20.0. Instead, use detailPress event.
tap(oControlEvent)
Fires when the user taps on the control.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Deprecated:
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:
{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.m.ListItemBase.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.ListItemBase.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.m.ListItemBase
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Since:
1.28.0
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
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:
{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.m.ListItemBase itself
Returns:
{sap.m.ListItemBase} Reference 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:
{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.m.ListItemBase itself
Returns:
{sap.m.ListItemBase} Reference 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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.ListItemBase} Reference 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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
fireDetailPress(mArguments?): sap.m.ListItemBase
Fires event detailPress to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
firePress(mArguments?): sap.m.ListItemBase
Fires event press to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Since:
1.28.0
Returns:
{sap.ui.core.Control[]}
getCounter(): int
Gets current value of property counter.

Defines the counter value of the list items.

Returns:
{int} Value of property counter
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:
{boolean} Value of property selected
getTabbables(): jQuery
Returns the tabbable DOM elements as a jQuery collection
Since:
1.26
Returns:
{jQuery} jQuery object
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.ListType} Value 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:
{boolean} Value 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:
{boolean} Value of property visible
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Since:
1.28.0
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaLabelledBy The ariaLabelledByto be removed or its index or ID
Since:
1.28.0
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
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:
{int}iCounter New value for property counter
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
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:
{boolean}bSelected New value for property selected
Returns:
{sap.m.ListItemBase} Reference 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.ListType}sType New value for property type
Returns:
{sap.m.ListItemBase} Reference 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:
{boolean}bUnread New value for property unread
Returns:
{sap.m.ListItemBase} Reference 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:
{boolean}bVisible New value for property visible
Returns:
{sap.m.ListItemBase} Reference 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:
{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.m.ListItemBase itself
Deprecated:
Since version 1.20.0. Instead, use detailPress event.
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
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:
{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.m.ListItemBase itself
Deprecated:
Since version 1.20.0. Instead, use press event.
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Deprecated:
Since version 1.20.0. Instead, use detailPress event.
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Deprecated:
Since version 1.20.0. Instead, use press event.
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
fireDetailTap(mArguments?): sap.m.ListItemBase
Fires event detailTap to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Deprecated:
Since version 1.20.0. Instead, use detailPress event.
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining
fireTap(mArguments?): sap.m.ListItemBase
Fires event tap to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Deprecated:
Since version 1.20.0. Instead, use press event.
Returns:
{sap.m.ListItemBase} Reference to this in order to allow method chaining