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 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 |
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 |
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. |
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. |
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 |
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. |
Method | Description |
---|---|
addNotifier |
Adds some notifier to the aggregation notifiers. |
attachDisplay |
Attaches event handler When called, the context of the event handler (its 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 When called, the context of the event handler (its 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 The passed function and listener object must match the ones used for event registration. |
detachResize |
Detaches event handler 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
|
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 |
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 |
getVisibleStatus |
Gets current value of property visibleStatus. This property displays the bar corresponding to given status Default value is |
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 |
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 Default value is |
setVisibleStatus |
Sets a new value for property visibleStatus. This property displays the bar corresponding to given status When called with a value of Default value is |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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. |
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 a metadata object for class sap.ui.ux3.NotificationBar.
Gets content of aggregation notifiers.
Notifiers that monitor something within the application and display the corresponding notifications.
Gets current value of property resizeEnabled.
This property enables the bar to be resized by the user.
Default value is true
.
Gets current value of property visibleStatus.
This property displays the bar corresponding to given status
Default value is Default
.
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.
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 |
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 |
Removes all the controls from the aggregation notifiers.
Additionally, it unregisters them from the hosting UIArea.
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 |
Param | Type | DefaultValue | Description |
---|---|---|---|
bAlwaysShow | boolean |
if the toggler should be visible all the time set this parameter to true |
Sets the aggregated messageNotifier.
Param | Type | DefaultValue | Description |
---|---|---|---|
oMessageNotifier | sap.ui.core.Element |
The messageNotifier to set |
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 |
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 |