abstract class sap.m.NotificationListBase

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/m/NotificationListBase
Application Component: CA-UI5-CTR

The NotificationListBase is the abstract base class for sap.m.NotificationListItem and sap.m.NotificationListGroup.

The NotificationList controls are designed for the SAP Fiori notification center.

Overview

NotificationListBase defines the general structure of a notification item. Most of the behavioral logic is defined for the single items or groups.

Structure

The base holds properties for the following elements:

Additionally, by setting these properties you can determine if buttons are shown:

Note

There are several properties, that are inherited from ListItemBase and have no visual representation in the Notifications - counter, highlight, highlightText, navigated, selected, type


Constructor

Constructor for a new NotificationListBase.

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.NotificationListBase(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
authorName string empty string

Determines the notification author name.

Visibility: public
authorPicture sap.ui.core.URI

Determines the URL of the notification author picture.

Visibility: public
datetime string empty string

The time stamp of the Notification.

Visibility: public
priority sap.ui.core.Priority None

Determines the priority of the Notification.

Visibility: public
showButtons boolean true

Determines the action buttons visibility.

Note: Action buttons are not shown when Notification List Groups are collapsed.

Visibility: public
showCloseButton boolean true

Determines the visibility of the close button.

Visibility: public
title string empty string

Determines the title of the NotificationListBase item.

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:

Name Cardinality Type Description
_closeButton 0..1 sap.m.Button

Close button.

_overflowToolbar 0..1 sap.m.OverflowToolbar

The overflow toolbar.

_priorityIcon 0..1 sap.ui.core.Icon

The priority icon.

buttons 0..n sap.m.Button

Action buttons.


Events Overview

Event Description
close

Fired when the close button of the notification is pressed.
Note: Pressing the close button doesn't destroy the notification automatically.

close

Fired when the close button of the notification is pressed.
Note: Pressing the close button doesn't destroy the notification automatically.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addButton

Adds some button to the aggregation buttons.

attachClose

Attaches event handler fnFunction to the close event of this sap.m.NotificationListBase.

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.NotificationListBase itself.

Fired when the close button of the notification is pressed.
Note: Pressing the close button doesn't destroy the notification automatically.

close

Closes the NotificationListBase.

destroyButtons

Destroys all the buttons in the aggregation buttons.

detachClose

Detaches event handler fnFunction from the close event of this sap.m.NotificationListBase.

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

sap.m.NotificationListBase.extend

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

fireClose

Fires event close to attached listeners.

getAuthorName

Gets current value of property authorName.

Determines the notification author name.

Default value is empty string.

getAuthorPicture

Gets current value of property authorPicture.

Determines the URL of the notification author picture.

getButtons

Gets content of aggregation buttons.

Action buttons.

getDatetime

Gets current value of property datetime.

The time stamp of the Notification.

Default value is empty string.

sap.m.NotificationListBase.getMetadata

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

getPriority

Gets current value of property priority.

Determines the priority of the Notification.

Default value is None.

getShowButtons

Gets current value of property showButtons.

Determines the action buttons visibility.

Note: Action buttons are not shown when Notification List Groups are collapsed.

Default value is true.

getShowCloseButton

Gets current value of property showCloseButton.

Determines the visibility of the close button.

Default value is true.

getTitle

Gets current value of property title.

Determines the title of the NotificationListBase item.

Default value is empty string.

indexOfButton

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

insertButton

Inserts a button into the aggregation buttons.

removeAllButtons

Removes all the controls from the aggregation buttons.

Additionally, it unregisters them from the hosting UIArea.

removeButton

Removes a button from the aggregation buttons.

setAuthorName

Sets a new value for property authorName.

Determines the notification author name.

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

Default value is empty string.

setAuthorPicture

Sets a new value for property authorPicture.

Determines the URL of the notification author picture.

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

setDatetime

Sets a new value for property datetime.

The time stamp of the Notification.

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

Default value is empty string.

setPriority

Sets a new value for property priority.

Determines the priority of the Notification.

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

Default value is None.

setShowButtons

Sets a new value for property showButtons.

Determines the action buttons visibility.

Note: Action buttons are not shown when Notification List Groups are collapsed.

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

Default value is true.

setShowCloseButton

Sets a new value for property showCloseButton.

Determines the visibility of the close button.

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

Default value is true.

setTitle

Sets a new value for property title.

Determines the title of the NotificationListBase item.

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

Default value is empty string.

addButton

Adds some button to the aggregation buttons.

Param Type DefaultValue Description
oButton sap.m.Button

The button to add; if empty, nothing is inserted

attachClose

Attaches event handler fnFunction to the close event of this sap.m.NotificationListBase.

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.NotificationListBase itself.

Fired when the close button of the notification is pressed.
Note: Pressing the close button doesn't destroy the notification automatically.

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 sap.m.NotificationListBase itself

close

Closes the NotificationListBase.

destroyButtons

Destroys all the buttons in the aggregation buttons.

detachClose

Detaches event handler fnFunction from the close event of this sap.m.NotificationListBase.

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

sap.m.NotificationListBase.extend

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

fireClose

Fires event close to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAuthorName

Gets current value of property authorName.

Determines the notification author name.

Default value is empty string.

getAuthorPicture

Gets current value of property authorPicture.

Determines the URL of the notification author picture.

getButtons

Gets content of aggregation buttons.

Action buttons.

getDatetime

Gets current value of property datetime.

The time stamp of the Notification.

Default value is empty string.

sap.m.NotificationListBase.getMetadata

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

getPriority

Gets current value of property priority.

Determines the priority of the Notification.

Default value is None.

getShowButtons

Gets current value of property showButtons.

Determines the action buttons visibility.

Note: Action buttons are not shown when Notification List Groups are collapsed.

Default value is true.

getShowCloseButton

Gets current value of property showCloseButton.

Determines the visibility of the close button.

Default value is true.

getTitle

Gets current value of property title.

Determines the title of the NotificationListBase item.

Default value is empty string.

indexOfButton

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

Param Type DefaultValue Description
oButton sap.m.Button

The button whose index is looked for

insertButton

Inserts a button into the aggregation buttons.

Param Type DefaultValue Description
oButton sap.m.Button

The button to insert; if empty, nothing is inserted

iIndex int

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

removeAllButtons

Removes all the controls from the aggregation buttons.

Additionally, it unregisters them from the hosting UIArea.

removeButton

Removes a button from the aggregation buttons.

Param Type DefaultValue Description
vButton int string sap.m.Button

The button to remove or its index or id

setAuthorName

Sets a new value for property authorName.

Determines the notification author name.

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
sAuthorName string ''

New value for property authorName

setAuthorPicture

Sets a new value for property authorPicture.

Determines the URL of the notification author picture.

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

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

New value for property authorPicture

setDatetime

Sets a new value for property datetime.

The time stamp of the Notification.

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
sDatetime string ''

New value for property datetime

setPriority

Sets a new value for property priority.

Determines the priority of the Notification.

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
sPriority sap.ui.core.Priority None

New value for property priority

setShowButtons

Sets a new value for property showButtons.

Determines the action buttons visibility.

Note: Action buttons are not shown when Notification List Groups are collapsed.

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
bShowButtons boolean true

New value for property showButtons

setShowCloseButton

Sets a new value for property showCloseButton.

Determines the visibility of the close button.

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
bShowCloseButton boolean true

New value for property showCloseButton

setTitle

Sets a new value for property title.

Determines the title of the NotificationListBase item.

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
sTitle string ''

New value for property title