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.
NotificationListBase defines the general structure of a notification item. Most of the behavioral logic is defined for the single items or groups.
The base holds properties for the following elements:
showButtons
- action buttons visibilityshowCloseButton
- close button visibility There are several properties, that are inherited from ListItemBase
and have no visual representation in the Notifications - counter
, highlight
, highlightText
, navigated
, selected
, type
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 |
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 |
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 |
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. |
Event | Description |
---|---|
close |
Fired when the close button of the notification is pressed. |
Method | Description |
---|---|
addButton |
Adds some button to the aggregation buttons. |
attachClose |
Attaches event handler When called, the context of the event handler (its Fired when the close button of the notification is pressed. |
close |
Closes the NotificationListBase. |
destroyButtons |
Destroys all the buttons in the aggregation buttons. |
detachClose |
Detaches event handler 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
|
fireClose |
Fires event close to attached listeners. |
getAuthorName |
Gets current value of property authorName. Determines the notification author name. Default value is |
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 |
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 |
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 |
getShowCloseButton |
Gets current value of property showCloseButton. Determines the visibility of the close button. Default value is |
getTitle |
Gets current value of property title. Determines the title of the NotificationListBase item. Default value is |
indexOfButton |
Checks for the provided |
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 Default value is |
setAuthorPicture |
Sets a new value for property authorPicture. Determines the URL of the notification author picture. When called with a value of |
setDatetime |
Sets a new value for property datetime. The time stamp of the Notification. When called with a value of Default value is |
setPriority |
Sets a new value for property priority. Determines the priority of the Notification. When called with a value of Default value is |
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 Default value is |
setShowCloseButton |
Sets a new value for property showCloseButton. Determines the visibility of the close button. When called with a value of Default value is |
setTitle |
Sets a new value for property title. Determines the title of the NotificationListBase item. When called with a value of Default value is |
Adds some button to the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.m.Button |
The button to add; if empty, nothing is inserted |
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 |
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 |
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 |
Fires event close to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Gets current value of property authorName.
Determines the notification author name.
Default value is empty string
.
Gets current value of property authorPicture.
Determines the URL of the notification author picture.
Gets current value of property datetime.
The time stamp of the Notification.
Default value is empty string
.
Returns a metadata object for class sap.m.NotificationListBase.
Gets current value of property priority.
Determines the priority of the Notification.
Default value is None
.
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
.
Gets current value of property showCloseButton.
Determines the visibility of the close button.
Default value is true
.
Gets current value of property title.
Determines the title of the NotificationListBase item.
Default value is empty string
.
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 |
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 |
Removes all the controls from the aggregation buttons.
Additionally, it unregisters them from the hosting UIArea.
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |