Class sap.ui.ux3.NotificationBarModule: sap/ui/ux3/NotificationBar

extends Control

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.
Deprecated API:
Since version 1.38. Instead, use the sap.m.MessagePopover control.

Since: 1.7.0.
Constructor Summary
new sap.ui.ux3.NotificationBar(sId?, mSettings?)Constructor for a new NotificationBar.
Event Summary
display(oControlEvent)Event is fired when the bar wants to be displayed depending on given flag.
resize(oControlEvent)This event is thrown when the bar was resized (to the different valid states: Min, Max, Default, None).
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.ux3.NotificationBar.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.ux3.NotificationBar with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.ux3.NotificationBar.getMetadata()Returns a metadata object for class sap.ui.ux3.NotificationBar.
addNotifier(oNotifier)Adds some notifier to the aggregation notifiers.
attachDisplay(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the display event of this sap.ui.ux3.NotificationBar.
attachResize(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the resize event of this sap.ui.ux3.NotificationBar.
destroyMessageNotifier()Destroys the messageNotifier in the aggregation messageNotifier.
destroyNotifiers()Destroys all the notifiers in the aggregation notifiers.
detachDisplay(fnFunction, oListener)Detaches event handler fnFunction from the display event of this sap.ui.ux3.NotificationBar.
detachResize(fnFunction, oListener)Detaches event handler fnFunction from the resize event of this sap.ui.ux3.NotificationBar.
fireDisplay(mParameters?)Fires event display to attached listeners.
fireResize(mParameters?)Fires event resize to attached listeners.
getAlwaysShowToggler()Gets current value of property alwaysShowToggler.
getMessageNotifier()Gets content of aggregation messageNotifier.
getNotifiers()Gets content of aggregation notifiers.
getResizeEnabled()Gets current value of property resizeEnabled.
getVisibleStatus()Gets current value of property visibleStatus.
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.
indexOfNotifier(oNotifier)Checks for the provided sap.ui.core.Element in the aggregation notifiers.
insertNotifier(oNotifier, iIndex)Inserts a notifier into the aggregation notifiers.
removeAllNotifiers()Removes all the controls from the aggregation notifiers.
removeNotifier(vNotifier)Removes a notifier from the aggregation notifiers.
setMessageNotifier(oMessageNotifier)Sets the aggregated messageNotifier.
setResizeEnabled(bResizeEnabled)Sets a new value for property resizeEnabled.
setVisibleStatus(sVisibleStatus)Sets a new value for property visibleStatus.
Constructor Detail
new sap.ui.ux3.NotificationBar(sId?, mSettings?)

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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

  • Aggregations

  • Events

    • display : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • resize : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Event Detail
display(oControlEvent)
Event is fired when the bar wants to be displayed depending on given flag. This allows the application to decide what to do.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
booleanoControlEvent.getParameters.showIndicates if the bar wants to be shown or hidden
resize(oControlEvent)
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.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.ux3.NotificationBarStatusoControlEvent.getParameters.statusThe corresponding status to which the bar was resized. The corresponding heights can be taken for the bar's CSS file.
Since:
1.12.2
Method Detail
sap.ui.ux3.NotificationBar.extend(sClassName, oClassInfo?, FNMetaImpl?): function

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.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.ux3.NotificationBar.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.ux3.NotificationBar.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addNotifier(oNotifier): sap.ui.ux3.NotificationBar
Adds some notifier to the aggregation notifiers.
Parameters:
sap.ui.core.ElementoNotifierthe notifier to add; if empty, nothing is inserted
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
attachDisplay(oData?, fnFunction, oListener?): sap.ui.ux3.NotificationBar

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.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.ux3.NotificationBar itself
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
attachResize(oData?, fnFunction, oListener?): sap.ui.ux3.NotificationBar

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.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.ux3.NotificationBar itself
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
Since:
1.12.2
destroyMessageNotifier(): sap.ui.ux3.NotificationBar
Destroys the messageNotifier in the aggregation messageNotifier.
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
destroyNotifiers(): sap.ui.ux3.NotificationBar
Destroys all the notifiers in the aggregation notifiers.
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
detachDisplay(fnFunction, oListener): sap.ui.ux3.NotificationBar

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
detachResize(fnFunction, oListener): sap.ui.ux3.NotificationBar

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.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
Since:
1.12.2
fireDisplay(mParameters?): sap.ui.ux3.NotificationBar
Fires event display to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
booleanmParameters.show?Indicates if the bar wants to be shown or hidden
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
fireResize(mParameters?): sap.ui.ux3.NotificationBar
Fires event resize to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.ux3.NotificationBarStatusmParameters.status?The corresponding status to which the bar was resized. The corresponding heights can be taken for the bar's CSS file.
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
Since:
1.12.2
getAlwaysShowToggler(): boolean

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.

Returns:
booleanValue of property alwaysShowToggler
getMessageNotifier(): sap.ui.core.Element

Gets content of aggregation messageNotifier.

Notifier that shows messages

Returns:
sap.ui.core.Element
getNotifiers(): sap.ui.core.Element[]

Gets content of aggregation notifiers.

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

Returns:
sap.ui.core.Element[]
getResizeEnabled(): boolean

Gets current value of property resizeEnabled.

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

Default value is true.

Returns:
booleanValue of property resizeEnabled

Gets current value of property visibleStatus.

This property displays the bar corresponding to given status

Default value is Default.

Returns:
sap.ui.ux3.NotificationBarStatusValue of property visibleStatus
hasItems(): boolean
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.
Returns:
boolean
indexOfNotifier(oNotifier): int
Checks for the provided sap.ui.core.Element in the aggregation notifiers. and returns its index if found or -1 otherwise.
Parameters:
sap.ui.core.ElementoNotifierThe notifier whose index is looked for
Returns:
intThe index of the provided control in the aggregation if found, or -1 otherwise
insertNotifier(oNotifier, iIndex): sap.ui.ux3.NotificationBar
Inserts a notifier into the aggregation notifiers.
Parameters:
sap.ui.core.ElementoNotifierthe notifier to insert; if empty, nothing is inserted
intiIndexthe 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
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
removeAllNotifiers(): sap.ui.core.Element[]

Removes all the controls from the aggregation notifiers.

Additionally, it unregisters them from the hosting UIArea.

Returns:
sap.ui.core.Element[]An array of the removed elements (might be empty)
removeNotifier(vNotifier): sap.ui.core.Element
Removes a notifier from the aggregation notifiers.
Parameters:
int|string|sap.ui.core.ElementvNotifierThe notifier to remove or its index or id
Returns:
sap.ui.core.ElementThe removed notifier or null
setAlwaysShowToggler(bAlwaysShow)
Parameters:
booleanbAlwaysShowif the toggler should be visible all the time set this parameter to true
Since:
1.22.11
setMessageNotifier(oMessageNotifier): sap.ui.ux3.NotificationBar
Sets the aggregated messageNotifier.
Parameters:
sap.ui.core.ElementoMessageNotifierThe messageNotifier to set
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
setResizeEnabled(bResizeEnabled): sap.ui.ux3.NotificationBar

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.

Parameters:
booleanbResizeEnabledNew value for property resizeEnabled
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining
setVisibleStatus(sVisibleStatus): sap.ui.ux3.NotificationBar

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.

Parameters:
sap.ui.ux3.NotificationBarStatussVisibleStatusNew value for property visibleStatus
Returns:
sap.ui.ux3.NotificationBarReference to this in order to allow method chaining