class sap.m.ObjectListItem

Control sample: sap.m.ObjectListItem
Visiblity: public
UX Guidelines: Object List Item
Implements:
Available since: N/A
Module: sap/m/ObjectListItem
Application Component: CA-UI5-CTR

ObjectListItem is a display control that provides summary information about an object as a list item. The ObjectListItem title is the key identifier of the object. Additional text and icons can be used to further distinguish it from other objects. Attributes and statuses can be used to provide additional meaning about the object to the user.

Note: The control must only be used in the context of a list.

This control can be a drag source.
This control can be a drop target.

Constructor

Constructor for a new ObjectListItem.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.m.ObjectListItem(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
activeIcon sap.ui.core.URI

Icon displayed when the ObjectListItem is active.

Visibility: public
icon sap.ui.core.URI

ObjectListItem icon displayed to the left of the title.

Visibility: public
iconDensityAware boolean true

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image (in case this version of image doesn't exist on the server).

If bandwidth is key for the application, set this value to false.

Visibility: public
intro string

Defines the introductory text for the ObjectListItem.

Visibility: public
introTextDirection sap.ui.core.TextDirection Inherit

Determines the text direction of the item intro. Available options for the intro direction are LTR (left-to-right) and RTL (right-to-left). By default the item intro inherits the text direction from its parent.

Visibility: public
markFavorite boolean

Sets the favorite state for the ObjectListItem.



Since: 1.16.0.

Visibility: public
markFlagged boolean

Sets the flagged state for the ObjectListItem.



Since: 1.16.0.

Visibility: public
markLocked boolean false

Sets the locked state of the ObjectListItem.



Since: 1.28.

Visibility: public
number string

Defines the ObjectListItem number.

Visibility: public
numberState sap.ui.core.ValueState None

Defines the ObjectListItem number and numberUnit value state.

Since: 1.16.0.

Visibility: public
numberTextDirection sap.ui.core.TextDirection Inherit

Determines the text direction of the item number. Available options for the number direction are LTR (left-to-right) and RTL (right-to-left). By default the item number inherits the text direction from its parent.

Visibility: public
numberUnit string

Defines the number units qualifier of the ObjectListItem.

Visibility: public
showMarkers boolean

If set to true, the ObjectListItem can be marked with icons such as favorite and flag.



Since: 1.16.0.

Visibility: public
title string

Defines the ObjectListItem title.

Visibility: public
titleTextDirection sap.ui.core.TextDirection Inherit

Determines the text direction of the item title. Available options for the title direction are LTR (left-to-right) and RTL (right-to-left). By default the item title inherits the text direction from its parent.

Visibility: public

Borrowed Properties

Name Type Default Value Description
counter int

Defines the counter value of the list items.

Visibility: public
highlight string None

Defines the highlight state of the list items.

Valid values for the highlight property are values of the enumerations sap.ui.core.MessageType or sap.ui.core.IndicationColor.

Accessibility support is provided through the associated highlightText property. If the highlight property is set to a value of sap.ui.core.MessageType, the highlightText property does not need to be set because a default text is used. However, the default text can be overridden by setting the highlightText property. In all other cases the highlightText property must be set.

Since: 1.44.0.

Visibility: public
highlightText string empty string

Defines the semantics of the highlight property for accessibility purposes.

Since: 1.62.

Visibility: public
navigated boolean false

The navigated state of the list item.

If set to true, a navigation indicator is displayed at the end of the list item. Note: This property must be set for one list item only.

Since: 1.72.

Visibility: public
selected boolean false

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.

Visibility: public
type sap.m.ListType Inactive

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

Visibility: public
unread boolean false

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.

Visibility: public
visible boolean true

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

Visibility: public

Aggregations

Default Aggregation: attributes

Name Cardinality Type Description
_objectNumber 0..1 sap.m.ObjectNumber

Internal sap.m.ObjectNumber control which is created based on the number, numberUnit, numberState, numberTextDirection

attributes (default) 0..n sap.m.ObjectAttribute

List of attributes displayed below the title to the left of the status fields.

firstStatus 0..1 sap.m.ObjectStatus

First status text field displayed on the right side of the attributes.

markers 0..n sap.m.ObjectMarker

List of markers (icon and/or text) that can be displayed for the ObjectListItems, such as favorite and flagged.

Note: You should use either this aggregation or the already deprecated properties - markFlagged, markFavorite, and markLocked. Using both can lead to unexpected results.

secondStatus 0..1 sap.m.ObjectStatus

Second status text field displayed on the right side of the attributes.


Methods Overview

Method Description
addAttribute

Adds some attribute to the aggregation attributes.

addMarker

Adds some marker to the aggregation markers.

destroyAttributes

Destroys all the attributes in the aggregation attributes.

destroyFirstStatus

Destroys the firstStatus in the aggregation firstStatus.

destroyMarkers

Destroys all the markers in the aggregation markers.

destroySecondStatus

Destroys the secondStatus in the aggregation secondStatus.

sap.m.ObjectListItem.extend

Creates a new subclass of class sap.m.ObjectListItem with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.ListItemBase.extend.

getActiveIcon

Gets current value of property activeIcon.

Icon displayed when the ObjectListItem is active.

getAttributes

Gets content of aggregation attributes.

List of attributes displayed below the title to the left of the status fields.

getFirstStatus

Gets content of aggregation firstStatus.

First status text field displayed on the right side of the attributes.

getIcon

Gets current value of property icon.

ObjectListItem icon displayed to the left of the title.

getIconDensityAware

Gets current value of property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image (in case this version of image doesn't exist on the server).

If bandwidth is key for the application, set this value to false.

Default value is true.

getIntro

Gets current value of property intro.

Defines the introductory text for the ObjectListItem.

getIntroTextDirection

Gets current value of property introTextDirection.

Determines the text direction of the item intro. Available options for the intro direction are LTR (left-to-right) and RTL (right-to-left). By default the item intro inherits the text direction from its parent.

Default value is Inherit.

getMarkers

Gets content of aggregation markers.

List of markers (icon and/or text) that can be displayed for the ObjectListItems, such as favorite and flagged.

Note: You should use either this aggregation or the already deprecated properties - markFlagged, markFavorite, and markLocked. Using both can lead to unexpected results.

getMarkFavorite

Gets current value of property markFavorite.

Sets the favorite state for the ObjectListItem.

Since 1.42.0 replaced by <code>markers</code> aggregation. Add {@link sap.m.ObjectMarker} with type <code>sap.m.ObjectMarkerType.Favorite</code>. You should use either this property or the <code>markers</code> aggregation, using both may lead to unpredicted behavior.
getMarkFlagged

Gets current value of property markFlagged.

Sets the flagged state for the ObjectListItem.

Since 1.42.0 replaced by <code>markers</code> aggregation. Add {@link sap.m.ObjectMarker} with type <code>sap.m.ObjectMarkerType.Flagged</code>. You should use either this property or the <code>markers</code> aggregation, using both may lead to unpredicted behavior.
getMarkLocked

Gets current value of property markLocked.

Sets the locked state of the ObjectListItem.

Default value is false.

Since 1.42.0 replaced by <code>markers</code> aggregation. Add {@link sap.m.ObjectMarker} with type <code>sap.m.ObjectMarkerType.Locked</code>. You should use either this property or the <code>markers</code> aggregation, using both may lead to unpredicted behavior.<br><br>
sap.m.ObjectListItem.getMetadata

Returns a metadata object for class sap.m.ObjectListItem.

getNumber

Gets current value of property number.

Defines the ObjectListItem number.

getNumberState

Gets current value of property numberState.

Defines the ObjectListItem number and numberUnit value state.

Default value is None.

getNumberTextDirection

Gets current value of property numberTextDirection.

Determines the text direction of the item number. Available options for the number direction are LTR (left-to-right) and RTL (right-to-left). By default the item number inherits the text direction from its parent.

Default value is Inherit.

getNumberUnit

Gets current value of property numberUnit.

Defines the number units qualifier of the ObjectListItem.

getSecondStatus

Gets content of aggregation secondStatus.

Second status text field displayed on the right side of the attributes.

getShowMarkers

Gets current value of property showMarkers.

If set to true, the ObjectListItem can be marked with icons such as favorite and flag.

Since 1.42.0 replaced by <code>markers</code> aggregation. This property is valid only if you are using the already deprecated properties - <code>markFlagged</code>, <code>markFavorite</code>, and <code>markLocked</code>. If you are using the <code>markers</code> aggregation, the visibility of the markers depends on what is set in the aggregation itself.
getTitle

Gets current value of property title.

Defines the ObjectListItem title.

getTitleTextDirection

Gets current value of property titleTextDirection.

Determines the text direction of the item title. Available options for the title direction are LTR (left-to-right) and RTL (right-to-left). By default the item title inherits the text direction from its parent.

Default value is Inherit.

indexOfAttribute

Checks for the provided sap.m.ObjectAttribute in the aggregation attributes. and returns its index if found or -1 otherwise.

indexOfMarker

Checks for the provided sap.m.ObjectMarker in the aggregation markers. and returns its index if found or -1 otherwise.

insertAttribute

Inserts a attribute into the aggregation attributes.

insertMarker

Inserts a marker into the aggregation markers.

removeAllAttributes

Removes all the controls from the aggregation attributes.

Additionally, it unregisters them from the hosting UIArea.

removeAllMarkers

Removes all the controls from the aggregation markers.

Additionally, it unregisters them from the hosting UIArea.

removeAttribute

Removes a attribute from the aggregation attributes.

removeMarker

Removes a marker from the aggregation markers.

setActiveIcon

Sets a new value for property activeIcon.

Icon displayed when the ObjectListItem is active.

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

setFirstStatus

Sets the aggregated firstStatus.

setIcon

Sets a new value for property icon.

ObjectListItem icon displayed to the left of the title.

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

setIconDensityAware

Sets a new value for property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image (in case this version of image doesn't exist on the server).

If bandwidth is key for the application, set this value to false.

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

Default value is true.

setIntro

Sets a new value for property intro.

Defines the introductory text for the ObjectListItem.

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

setIntroTextDirection

Sets a new value for property introTextDirection.

Determines the text direction of the item intro. Available options for the intro direction are LTR (left-to-right) and RTL (right-to-left). By default the item intro inherits the text direction from its parent.

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

Default value is Inherit.

setMarkFavorite

Sets the visibility value of the Favorite marker.

setMarkFlagged

Sets the visibility value of the Flagged marker.

setMarkLocked

Sets the visibility value of the Favorite marker.

setNumber

Sets a new value for property number.

Defines the ObjectListItem number.

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

setNumberState

Sets a new value for property numberState.

Defines the ObjectListItem number and numberUnit value state.

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

Default value is None.

setNumberTextDirection

Sets a new value for property numberTextDirection.

Determines the text direction of the item number. Available options for the number direction are LTR (left-to-right) and RTL (right-to-left). By default the item number inherits the text direction from its parent.

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

Default value is Inherit.

setNumberUnit

Sets a new value for property numberUnit.

Defines the number units qualifier of the ObjectListItem.

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

setSecondStatus

Sets the aggregated secondStatus.

setShowMarkers

Sets the visibility value of the Flagged and Favorite markers.

setTitle

Sets a new value for property title.

Defines the ObjectListItem title.

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

setTitleTextDirection

Sets a new value for property titleTextDirection.

Determines the text direction of the item title. Available options for the title direction are LTR (left-to-right) and RTL (right-to-left). By default the item title inherits the text direction from its parent.

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

Default value is Inherit.

addAttribute

Adds some attribute to the aggregation attributes.

Param Type DefaultValue Description
oAttribute sap.m.ObjectAttribute

The attribute to add; if empty, nothing is inserted

addMarker

Adds some marker to the aggregation markers.

Param Type DefaultValue Description
oMarker sap.m.ObjectMarker

The marker to add; if empty, nothing is inserted

destroyAttributes

Destroys all the attributes in the aggregation attributes.

destroyFirstStatus

Destroys the firstStatus in the aggregation firstStatus.

destroyMarkers

Destroys all the markers in the aggregation markers.

destroySecondStatus

Destroys the secondStatus in the aggregation secondStatus.

sap.m.ObjectListItem.extend

Creates a new subclass of class sap.m.ObjectListItem with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.ListItemBase.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getActiveIcon

Gets current value of property activeIcon.

Icon displayed when the ObjectListItem is active.

getAttributes

Gets content of aggregation attributes.

List of attributes displayed below the title to the left of the status fields.

getFirstStatus

Gets content of aggregation firstStatus.

First status text field displayed on the right side of the attributes.

getIcon

Gets current value of property icon.

ObjectListItem icon displayed to the left of the title.

getIconDensityAware

Gets current value of property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image (in case this version of image doesn't exist on the server).

If bandwidth is key for the application, set this value to false.

Default value is true.

getIntro

Gets current value of property intro.

Defines the introductory text for the ObjectListItem.

getIntroTextDirection

Gets current value of property introTextDirection.

Determines the text direction of the item intro. Available options for the intro direction are LTR (left-to-right) and RTL (right-to-left). By default the item intro inherits the text direction from its parent.

Default value is Inherit.

getMarkers

Gets content of aggregation markers.

List of markers (icon and/or text) that can be displayed for the ObjectListItems, such as favorite and flagged.

Note: You should use either this aggregation or the already deprecated properties - markFlagged, markFavorite, and markLocked. Using both can lead to unexpected results.

getMarkFavorite

Gets current value of property markFavorite.

Sets the favorite state for the ObjectListItem.

Since 1.42.0 replaced by <code>markers</code> aggregation. Add {@link sap.m.ObjectMarker} with type <code>sap.m.ObjectMarkerType.Favorite</code>. You should use either this property or the <code>markers</code> aggregation, using both may lead to unpredicted behavior.

getMarkFlagged

Gets current value of property markFlagged.

Sets the flagged state for the ObjectListItem.

Since 1.42.0 replaced by <code>markers</code> aggregation. Add {@link sap.m.ObjectMarker} with type <code>sap.m.ObjectMarkerType.Flagged</code>. You should use either this property or the <code>markers</code> aggregation, using both may lead to unpredicted behavior.

getMarkLocked

Gets current value of property markLocked.

Sets the locked state of the ObjectListItem.

Default value is false.

Since 1.42.0 replaced by <code>markers</code> aggregation. Add {@link sap.m.ObjectMarker} with type <code>sap.m.ObjectMarkerType.Locked</code>. You should use either this property or the <code>markers</code> aggregation, using both may lead to unpredicted behavior.<br><br>

sap.m.ObjectListItem.getMetadata

Returns a metadata object for class sap.m.ObjectListItem.

getNumber

Gets current value of property number.

Defines the ObjectListItem number.

getNumberState

Gets current value of property numberState.

Defines the ObjectListItem number and numberUnit value state.

Default value is None.

getNumberTextDirection

Gets current value of property numberTextDirection.

Determines the text direction of the item number. Available options for the number direction are LTR (left-to-right) and RTL (right-to-left). By default the item number inherits the text direction from its parent.

Default value is Inherit.

getNumberUnit

Gets current value of property numberUnit.

Defines the number units qualifier of the ObjectListItem.

getSecondStatus

Gets content of aggregation secondStatus.

Second status text field displayed on the right side of the attributes.

getShowMarkers

Gets current value of property showMarkers.

If set to true, the ObjectListItem can be marked with icons such as favorite and flag.

Since 1.42.0 replaced by <code>markers</code> aggregation. This property is valid only if you are using the already deprecated properties - <code>markFlagged</code>, <code>markFavorite</code>, and <code>markLocked</code>. If you are using the <code>markers</code> aggregation, the visibility of the markers depends on what is set in the aggregation itself.

getTitle

Gets current value of property title.

Defines the ObjectListItem title.

getTitleTextDirection

Gets current value of property titleTextDirection.

Determines the text direction of the item title. Available options for the title direction are LTR (left-to-right) and RTL (right-to-left). By default the item title inherits the text direction from its parent.

Default value is Inherit.

indexOfAttribute

Checks for the provided sap.m.ObjectAttribute in the aggregation attributes. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oAttribute sap.m.ObjectAttribute

The attribute whose index is looked for

indexOfMarker

Checks for the provided sap.m.ObjectMarker in the aggregation markers. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oMarker sap.m.ObjectMarker

The marker whose index is looked for

insertAttribute

Inserts a attribute into the aggregation attributes.

Param Type DefaultValue Description
oAttribute sap.m.ObjectAttribute

The attribute to insert; if empty, nothing is inserted

iIndex int

The 0-based index the attribute should be inserted at; for a negative value of iIndex, the attribute is inserted at position 0; for a value greater than the current size of the aggregation, the attribute is inserted at the last position

insertMarker

Inserts a marker into the aggregation markers.

Param Type DefaultValue Description
oMarker sap.m.ObjectMarker

The marker to insert; if empty, nothing is inserted

iIndex int

The 0-based index the marker should be inserted at; for a negative value of iIndex, the marker is inserted at position 0; for a value greater than the current size of the aggregation, the marker is inserted at the last position

removeAllAttributes

Removes all the controls from the aggregation attributes.

Additionally, it unregisters them from the hosting UIArea.

removeAllMarkers

Removes all the controls from the aggregation markers.

Additionally, it unregisters them from the hosting UIArea.

removeAttribute

Removes a attribute from the aggregation attributes.

Param Type DefaultValue Description
vAttribute int string sap.m.ObjectAttribute

The attribute to remove or its index or id

removeMarker

Removes a marker from the aggregation markers.

Param Type DefaultValue Description
vMarker int string sap.m.ObjectMarker

The marker to remove or its index or id

setActiveIcon

Sets a new value for property activeIcon.

Icon displayed when the ObjectListItem is active.

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

Param Type DefaultValue Description
sActiveIcon sap.ui.core.URI

New value for property activeIcon

setFirstStatus

Sets the aggregated firstStatus.

Param Type DefaultValue Description
oFirstStatus sap.m.ObjectStatus

The firstStatus to set

setIcon

Sets a new value for property icon.

ObjectListItem icon displayed to the left of the title.

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

Param Type DefaultValue Description
sIcon sap.ui.core.URI

New value for property icon

setIconDensityAware

Sets a new value for property iconDensityAware.

By default, this is set to true but then one or more requests are sent trying to get the density perfect version of image (in case this version of image doesn't exist on the server).

If bandwidth is key for the application, set this value to false.

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

Default value is true.

Param Type DefaultValue Description
bIconDensityAware boolean true

New value for property iconDensityAware

setIntro

Sets a new value for property intro.

Defines the introductory text for the ObjectListItem.

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

Param Type DefaultValue Description
sIntro string

New value for property intro

setIntroTextDirection

Sets a new value for property introTextDirection.

Determines the text direction of the item intro. Available options for the intro direction are LTR (left-to-right) and RTL (right-to-left). By default the item intro inherits the text direction from its parent.

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

Default value is Inherit.

Param Type DefaultValue Description
sIntroTextDirection sap.ui.core.TextDirection Inherit

New value for property introTextDirection

setMarkFavorite

Sets the visibility value of the Favorite marker.

Param Type DefaultValue Description
bMarked boolean

the new value

setMarkFlagged

Sets the visibility value of the Flagged marker.

Param Type DefaultValue Description
bMarked boolean

the new value

setMarkLocked

Sets the visibility value of the Favorite marker.

Param Type DefaultValue Description
bMarked boolean

the new value

setNumber

Sets a new value for property number.

Defines the ObjectListItem number.

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

Param Type DefaultValue Description
sNumber string

New value for property number

setNumberState

Sets a new value for property numberState.

Defines the ObjectListItem number and numberUnit value state.

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

Default value is None.

Param Type DefaultValue Description
sNumberState sap.ui.core.ValueState None

New value for property numberState

setNumberTextDirection

Sets a new value for property numberTextDirection.

Determines the text direction of the item number. Available options for the number direction are LTR (left-to-right) and RTL (right-to-left). By default the item number inherits the text direction from its parent.

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

Default value is Inherit.

Param Type DefaultValue Description
sNumberTextDirection sap.ui.core.TextDirection Inherit

New value for property numberTextDirection

setNumberUnit

Sets a new value for property numberUnit.

Defines the number units qualifier of the ObjectListItem.

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

Param Type DefaultValue Description
sNumberUnit string

New value for property numberUnit

setSecondStatus

Sets the aggregated secondStatus.

Param Type DefaultValue Description
oSecondStatus sap.m.ObjectStatus

The secondStatus to set

setShowMarkers

Sets the visibility value of the Flagged and Favorite markers.

Param Type DefaultValue Description
bMarked boolean

the new value

setTitle

Sets a new value for property title.

Defines the ObjectListItem title.

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

Param Type DefaultValue Description
sTitle string

New value for property title

setTitleTextDirection

Sets a new value for property titleTextDirection.

Determines the text direction of the item title. Available options for the title direction are LTR (left-to-right) and RTL (right-to-left). By default the item title inherits the text direction from its parent.

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

Default value is Inherit.

Param Type DefaultValue Description
sTitleTextDirection sap.ui.core.TextDirection Inherit

New value for property titleTextDirection