class sap.ui.ux3.NotificationBar

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/ux3/NotificationBar
Application Component: CA-UI5-CTR

A NotificationBar is a "toolbar" that can be added to a page to show messages and notifications from the application. Its position, height and width is inherited from the element that the notification bar is added to. The NotificationBar uses position: fixed; to always stay at the bottom of the screen. This CSS may sometimes cause issues when nested deeply inside other controls. To have a proper behavior of the NotificationBar use it as high in the control hierarchy as possible.


Constructor

Constructor for a new NotificationBar.

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.ui.ux3.NotificationBar(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
alwaysShowToggler boolean false

This property defines if the toggler should be displayed the whole time when the NotificationBar is shown.

Visibility: public
resizeEnabled boolean true

This property enables the bar to be resized by the user.

Visibility: public
visibleStatus sap.ui.ux3.NotificationBarStatus Default

This property displays the bar corresponding to given status

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
messageNotifier 0..1 sap.ui.core.Element

Notifier that shows messages

notifiers 0..n sap.ui.core.Element

Notifiers that monitor something within the application and display the corresponding notifications.


Events Overview

Event Description
display

Event is fired when the bar wants to be displayed depending on given flag. This allows the application to decide what to do.

resize

This event is thrown when the bar was resized (to the different valid states: Min, Max, Default, None). The event itself can be used from SAPUI5-version 1.12.2 since there was a bug in the previous versions firing this event.

Since: 1.12.2.

display

Event is fired when the bar wants to be displayed depending on given flag. This allows the application to decide what to do.

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

Indicates if the bar wants to be shown or hidden

resize

This event is thrown when the bar was resized (to the different valid states: Min, Max, Default, None). The event itself can be used from SAPUI5-version 1.12.2 since there was a bug in the previous versions firing this event.

Since: 1.12.2.

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

The corresponding status to which the bar was resized. The corresponding heights can be taken for the bar's CSS file.


Methods Overview

Method Description
addNotifier

Adds some notifier to the aggregation notifiers.

attachDisplay

Attaches event handler fnFunction to the display event of this sap.ui.ux3.NotificationBar.

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.ui.ux3.NotificationBar itself.

Event is fired when the bar wants to be displayed depending on given flag. This allows the application to decide what to do.

attachResize

Attaches event handler fnFunction to the resize event of this sap.ui.ux3.NotificationBar.

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.ui.ux3.NotificationBar itself.

This event is thrown when the bar was resized (to the different valid states: Min, Max, Default, None). The event itself can be used from SAPUI5-version 1.12.2 since there was a bug in the previous versions firing this event.

destroyMessageNotifier

Destroys the messageNotifier in the aggregation messageNotifier.

destroyNotifiers

Destroys all the notifiers in the aggregation notifiers.

detachDisplay

Detaches event handler fnFunction from the display event of this sap.ui.ux3.NotificationBar.

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

detachResize

Detaches event handler fnFunction from the resize event of this sap.ui.ux3.NotificationBar.

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

sap.ui.ux3.NotificationBar.extend

Creates a new subclass of class sap.ui.ux3.NotificationBar 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.

fireDisplay

Fires event display to attached listeners.

fireResize

Fires event resize to attached listeners.

getAlwaysShowToggler

Gets current value of property alwaysShowToggler.

This property defines if the toggler should be displayed the whole time when the NotificationBar is shown.

Default value is false.

getMessageNotifier

Gets content of aggregation messageNotifier.

Notifier that shows messages

sap.ui.ux3.NotificationBar.getMetadata

Returns a metadata object for class sap.ui.ux3.NotificationBar.

getNotifiers

Gets content of aggregation notifiers.

Notifiers that monitor something within the application and display the corresponding notifications.

getResizeEnabled

Gets current value of property resizeEnabled.

This property enables the bar to be resized by the user.

Default value is true.

getVisibleStatus

Gets current value of property visibleStatus.

This property displays the bar corresponding to given status

Default value is Default.

hasItems

This method checks if the NotificationBar has any items (notifications or messages) to show and returns true if there are any items to show. So the application should decide if the bar should be displayed.

indexOfNotifier

Checks for the provided sap.ui.core.Element in the aggregation notifiers. and returns its index if found or -1 otherwise.

insertNotifier

Inserts a notifier into the aggregation notifiers.

removeAllNotifiers

Removes all the controls from the aggregation notifiers.

Additionally, it unregisters them from the hosting UIArea.

removeNotifier

Removes a notifier from the aggregation notifiers.

setAlwaysShowToggler
setMessageNotifier

Sets the aggregated messageNotifier.

setResizeEnabled

Sets a new value for property resizeEnabled.

This property enables the bar to be resized by the user.

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

Default value is true.

setVisibleStatus

Sets a new value for property visibleStatus.

This property displays the bar corresponding to given status

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

Default value is Default.

addNotifier

Adds some notifier to the aggregation notifiers.

Param Type DefaultValue Description
oNotifier sap.ui.core.Element

The notifier to add; if empty, nothing is inserted

attachDisplay

Attaches event handler fnFunction to the display event of this sap.ui.ux3.NotificationBar.

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.ui.ux3.NotificationBar itself.

Event is fired when the bar wants to be displayed depending on given flag. This allows the application to decide what to do.

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.ui.ux3.NotificationBar itself

attachResize

Attaches event handler fnFunction to the resize event of this sap.ui.ux3.NotificationBar.

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.ui.ux3.NotificationBar itself.

This event is thrown when the bar was resized (to the different valid states: Min, Max, Default, None). The event itself can be used from SAPUI5-version 1.12.2 since there was a bug in the previous versions firing this event.

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.ui.ux3.NotificationBar itself

destroyMessageNotifier

Destroys the messageNotifier in the aggregation messageNotifier.

destroyNotifiers

Destroys all the notifiers in the aggregation notifiers.

detachDisplay

Detaches event handler fnFunction from the display event of this sap.ui.ux3.NotificationBar.

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

detachResize

Detaches event handler fnFunction from the resize event of this sap.ui.ux3.NotificationBar.

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.ui.ux3.NotificationBar.extend

Creates a new subclass of class sap.ui.ux3.NotificationBar 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

fireDisplay

Fires event display to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

show boolean

Indicates if the bar wants to be shown or hidden

fireResize

Fires event resize to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

status sap.ui.ux3.NotificationBarStatus

The corresponding status to which the bar was resized. The corresponding heights can be taken for the bar's CSS file.

getAlwaysShowToggler

Gets current value of property alwaysShowToggler.

This property defines if the toggler should be displayed the whole time when the NotificationBar is shown.

Default value is false.

getMessageNotifier

Gets content of aggregation messageNotifier.

Notifier that shows messages

sap.ui.ux3.NotificationBar.getMetadata

Returns a metadata object for class sap.ui.ux3.NotificationBar.

getNotifiers

Gets content of aggregation notifiers.

Notifiers that monitor something within the application and display the corresponding notifications.

getResizeEnabled

Gets current value of property resizeEnabled.

This property enables the bar to be resized by the user.

Default value is true.

getVisibleStatus

Gets current value of property visibleStatus.

This property displays the bar corresponding to given status

Default value is Default.

hasItems

This method checks if the NotificationBar has any items (notifications or messages) to show and returns true if there are any items to show. So the application should decide if the bar should be displayed.

indexOfNotifier

Checks for the provided sap.ui.core.Element in the aggregation notifiers. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oNotifier sap.ui.core.Element

The notifier whose index is looked for

insertNotifier

Inserts a notifier into the aggregation notifiers.

Param Type DefaultValue Description
oNotifier sap.ui.core.Element

The notifier to insert; if empty, nothing is inserted

iIndex int

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

removeAllNotifiers

Removes all the controls from the aggregation notifiers.

Additionally, it unregisters them from the hosting UIArea.

removeNotifier

Removes a notifier from the aggregation notifiers.

Param Type DefaultValue Description
vNotifier int string sap.ui.core.Element

The notifier to remove or its index or id

setAlwaysShowToggler

Param Type DefaultValue Description
bAlwaysShow boolean

if the toggler should be visible all the time set this parameter to true

setMessageNotifier

Sets the aggregated messageNotifier.

Param Type DefaultValue Description
oMessageNotifier sap.ui.core.Element

The messageNotifier to set

setResizeEnabled

Sets a new value for property resizeEnabled.

This property enables the bar to be resized by the user.

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

New value for property resizeEnabled

setVisibleStatus

Sets a new value for property visibleStatus.

This property displays the bar corresponding to given status

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

Default value is Default.

Param Type DefaultValue Description
sVisibleStatus sap.ui.ux3.NotificationBarStatus Default

New value for property visibleStatus