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.

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(mArguments?)Fires event display to attached listeners.
fireResize(mArguments?)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:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Deprecated:
Since version 1.38. Instead, use the sap.m.MessagePopover 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.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{boolean}oControlEvent.getParameters.show Indicates 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.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.ux3.NotificationBarStatus}oControlEvent.getParameters.status The 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:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created 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.Metadata} Metadata object describing this class
addNotifier(oNotifier): sap.ui.ux3.NotificationBar
Adds some notifier to the aggregation notifiers.
Parameters:
{sap.ui.core.Element}oNotifier the notifier to add; if empty, nothing is inserted
Returns:
{sap.ui.ux3.NotificationBar} Reference 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:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.ux3.NotificationBar itself
Returns:
{sap.ui.ux3.NotificationBar} Reference 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:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.ux3.NotificationBar itself
Since:
1.12.2
Returns:
{sap.ui.ux3.NotificationBar} Reference to this in order to allow method chaining
destroyMessageNotifier(): sap.ui.ux3.NotificationBar
Destroys the messageNotifier in the aggregation messageNotifier.
Returns:
{sap.ui.ux3.NotificationBar} Reference 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.NotificationBar} Reference 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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.ux3.NotificationBar} Reference 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:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Since:
1.12.2
Returns:
{sap.ui.ux3.NotificationBar} Reference to this in order to allow method chaining
fireDisplay(mArguments?): sap.ui.ux3.NotificationBar
Fires event display to attached listeners.

Expects the following event parameters:

  • show of type booleanIndicates if the bar wants to be shown or hidden
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.ux3.NotificationBar} Reference to this in order to allow method chaining
fireResize(mArguments?): sap.ui.ux3.NotificationBar
Fires event resize to attached listeners.

Expects the following event parameters:

  • status of type sap.ui.ux3.NotificationBarStatusThe corresponding status to which the bar was resized. The corresponding heights can be taken for the bar's CSS file.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.12.2
Returns:
{sap.ui.ux3.NotificationBar} Reference to this in order to allow method chaining
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:
{boolean} Value 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:
{boolean} Value 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.NotificationBarStatus} Value 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.Element}oNotifier The notifier whose index is looked for
Returns:
{int} The 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.Element}oNotifier the notifier to insert; if empty, nothing is inserted
{int}iIndex 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
Returns:
{sap.ui.ux3.NotificationBar} Reference 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.Element}vNotifier The notifierto remove or its index or id
Returns:
{sap.ui.core.Element} The removed notifier or null
setAlwaysShowToggler(boolean?)
Parameters:
{bAlwaysShow}boolean? if 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.Element}oMessageNotifier The messageNotifier to set
Returns:
{sap.ui.ux3.NotificationBar} Reference 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:
{boolean}bResizeEnabled New value for property resizeEnabled
Returns:
{sap.ui.ux3.NotificationBar} Reference 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.NotificationBarStatus}sVisibleStatus New value for property visibleStatus
Returns:
{sap.ui.ux3.NotificationBar} Reference to this in order to allow method chaining