ListItemBase contains the base features of all specific list items. Note: If not mentioned otherwise in the individual subclasses, list items must only be used in the items
aggregation of sap.m.ListBase
controls.
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#constructor for a general description of the syntax of the settings object.
new sap.m.ListItemBase(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 |
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 Accessibility support is provided through the associated highlightText property. If the |
highlightText | string | empty string | Defines the semantics of the highlight property for accessibility purposes. |
navigated | boolean | false | The navigated state of the list item. If set to |
selected | boolean | false | Defines the selected state of the list items. Note: Binding the |
type | sap.m.ListType | Inactive | Defines the visual indication and behavior of the list items, e.g. |
unread | boolean | false | Activates the unread indicator for the list item, if set to |
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 |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby). |
Event | Description |
---|---|
detailPress |
Fires when the user clicks on the detail button of the control. |
detailTap |
Fires when the user taps on the detail button of the control. |
press |
Fires when the user clicks on the control. Note: This event is not fired when the parent |
tap |
Fires when the user taps on the control. |
Fires when the user clicks on the detail button of the control.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Fires when the user taps on the detail button of the control.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
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.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object |
Method | Description |
---|---|
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
attachDetailPress |
Attaches event handler When called, the context of the event handler (its Fires when the user clicks on the detail button of the control. |
attachDetailTap |
Attaches event handler When called, the context of the event handler (its Fires when the user taps on the detail button of the control.
Since 1.20.0 Instead, use <code>detailPress</code> event.
|
attachPress |
Attaches event handler When called, the context of the event handler (its Fires when the user clicks on the control. Note: This event is not fired when the parent |
attachTap |
Attaches event handler When called, the context of the event handler (its Fires when the user taps on the control.
Since 1.20.0 Instead, use <code>press</code> event.
|
detachDetailPress |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachDetailTap |
Detaches event handler The passed function and listener object must match the ones used for event registration.
Since 1.20.0 Instead, use <code>detailPress</code> event.
|
detachPress |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachTap |
Detaches event handler The passed function and listener object must match the ones used for event registration.
Since 1.20.0 Instead, use <code>press</code> event.
|
sap.m.ListItemBase.extend |
Creates a new subclass of class sap.m.ListItemBase with name
|
fireDetailPress |
Fires event detailPress to attached listeners. |
fireDetailTap |
Fires event detailTap to attached listeners.
Since 1.20.0 Instead, use <code>detailPress</code> event.
|
firePress |
Fires event press to attached listeners. |
fireTap |
Fires event tap to attached listeners.
Since 1.20.0 Instead, use <code>press</code> event.
|
getAriaLabelledBy |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy. |
getContentAnnouncement |
Returns the accessibility announcement for the content. Hook for the subclasses. |
getCounter |
Gets current value of property counter. Defines the counter value of the list items. |
getHighlight |
Gets current value of property highlight. Defines the highlight state of the list items. Valid values for the Accessibility support is provided through the associated highlightText property. If the Default value is |
getHighlightText |
Gets current value of property highlightText. Defines the semantics of the highlight property for accessibility purposes. Default value is |
sap.m.ListItemBase.getMetadata |
Returns a metadata object for class sap.m.ListItemBase. |
getNavigated |
Gets current value of property navigated. The navigated state of the list item. If set to Default value is |
getSelected |
Gets current value of property selected. Defines the selected state of the list items. Note: Binding the Default value is |
getTabbables |
Returns the tabbable DOM elements as a jQuery collection |
getType |
Gets current value of property type. Defines the visual indication and behavior of the list items, e.g. Default value is |
getUnread |
Gets current value of property unread. Activates the unread indicator for the list item, if set to Default value is |
getVisible |
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 |
isSelected |
Returns the state of the item selection as a boolean
Since 1.10.2 API Change makes this method unnecessary. Use the {@link #getSelected} method instead.
|
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
setCounter |
Sets a new value for property counter. Defines the counter value of the list items. When called with a value of |
setHighlight |
Sets a new value for property highlight. Defines the highlight state of the list items. Valid values for the Accessibility support is provided through the associated highlightText property. If the When called with a value of Default value is |
setHighlightText |
Sets a new value for property highlightText. Defines the semantics of the highlight property for accessibility purposes. When called with a value of Default value is |
setNavigated |
Sets a new value for property navigated. The navigated state of the list item. If set to When called with a value of Default value is |
setSelected |
Sets a new value for property selected. Defines the selected state of the list items. Note: Binding the When called with a value of Default value is |
setType |
Sets a new value for property type. Defines the visual indication and behavior of the list items, e.g. When called with a value of Default value is |
setUnread |
Sets a new value for property unread. Activates the unread indicator for the list item, if set to When called with a value of Default value is |
setVisible |
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 Default value is |
Adds some ariaLabelledBy into the association ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to add; if empty, nothing is inserted |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
oData | object |
An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called when the event occurs |
|
oListener | object |
Context object to call the event handler with. Defaults to this |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
fnFunction | function(sap.ui.base.Event) : void |
The function to be called, when the event occurs |
|
oListener | object |
Context object on which the given function had to be called |
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.
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 |
Fires event detailPress to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event detailTap to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event press to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event tap to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns the accessibility announcement for the content.
Hook for the subclasses.
Gets current value of property highlight.
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.
Default value is "None"
.
Gets current value of property highlightText.
Defines the semantics of the highlight property for accessibility purposes.
Default value is empty string
.
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
.
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
.
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
.
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 the state of the item selection as a boolean
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to be removed or its index or ID |
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
iCounter | int |
New value for property |
Sets a new value for property highlight.
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.
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 |
---|---|---|---|
sHighlight | string | "None" |
New value for property |
Sets a new value for property highlightText.
Defines the semantics of the highlight property for accessibility purposes.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHighlightText | string | "" |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bSelected | boolean | false |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sType | sap.m.ListType | Inactive |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bUnread | boolean | false |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bVisible | boolean | true |
New value for property |