src/sap.ui.ux3/src/sap/ui/ux3/NotificationBar.js
function(oEvent) {
			var oCallout = oEvent.getParameter("callout");

			switch (oEvent.getParameter("type")) {
			case "added":
			case "removed":
				var oNotifier = oEvent.getParameter("notifier");

				if (this.getMessageNotifier() && this.getMessageNotifier().getId() === oNotifier.getId()) {
					// clone the message array to sort it
					fnSortMessages(this, this.getMessageNotifier());
				}

				if (fnChangeVisibility(this)) {
					var bShouldBeVisible = this.hasItems();
					this.fireDisplay({
						show : bShouldBeVisible
					});
				} else {
					/*
					 * Needed if i.e. all messages of a notifier were removed but if
					 * there are still notifications or messages to display
					 */
					this.invalidate();

					/*
					 * Needed if the message is directly removed from the Callout
					 * without any request to the user.
					 */
					if (oEvent.getParameter("type") === "removed") {
						/*
						 * Since the Callout has only one content - the NotifierView -
						 * it can be checked this way. If there is no content the
						 * Callout has been closed already.
						 */
						if (oCallout.getContent().length > 0) {
							var oNotiView = oCallout.getContent()[0];
							var oMessage = oEvent.getParameter("message");

							var aMessageViews = oNotiView.getMessages();
							var tmpMsgView;

							for (var i = 0; i < aMessageViews.length; i++) {
								tmpMsgView = aMessageViews[i];

								if (oMessage.getId() === tmpMsgView._message.getId()) {
									tmpMsgView.destroy();

									/*
									 * A normal invalidate on the NotifierView
									 * doesn't work here since the invalidate is
									 * delegated to the most upper parent -> the
									 * NotificationBar. If the NotificationBar is
									 * rendered it doesn't know something of the
									 * corresponding Callout. It would be possible
									 * to rerender the NotifierView but since the
									 * height of the Callout is reduced the
									 * Callout's position must be fixed as well.
									 * This happens also when the Callout is
									 * rerendered, so it saves some lines of codes
									 * to rerender the Callout itself.
									 */
									oCallout.rerender();

									/*
									 * An open Callout would loose its correct
									 * position due to the re-rendering. The
									 * followOf-functionality of the Popup doesn't
									 * work here, since the opener hasn't moved. See
									 * CSN 1625930 2013
									 */
									oCallout.adjustPosition();
									break;
								}
							}
						}
					}
				}

				break;

			case "openCallout":
				oCallout.destroyContent();

				var oNotifier = oEvent.getParameter("notifier");
				// destroy (renew) views that were previously created in maximized
				// mode
				oNotifier.destroyAggregation("views", true);
				var sId = oNotifier.getId();

				var oMessageNotifier = this.getMessageNotifier();

				if (oMessageNotifier && sId === oMessageNotifier.getId()) {
					sId += "-messageNotifierView";
				} else {
					sId += "-messageView";
				}

				// create control that renders the notifier's messages
				var oNotifierView = new NotificationBar.NotifierView(sId, {
					title : oNotifier.getTitle(),
					visibleItems : this._visibleItems
				});

				if (oNotifier._bEnableMessageSelect) {
					oNotifierView.addStyleClass("sapUiNotifierSelectable");
				}

				var aMessages = oNotifier.getMessages();
				for (var i = 0; i < aMessages.length; i++) {
					var oView = fnCreateMessageView(aMessages[i], oNotifier, this);
					oNotifierView.addMessage(oView);
				}

				// with adding this aggregation the view is destroyed as well if
				// needed
				oNotifier.addAggregation("views", oNotifierView, true);

				oCallout.addContent(oNotifierView);
				break;
			}
		}
function(oEvent) {
			var oCallout = oEvent.getParameter("callout");

			switch (oEvent.getParameter("type")) {
			case "added":
			case "removed":
				var oNotifier = oEvent.getParameter("notifier");

				if (this.getMessageNotifier() && this.getMessageNotifier().getId() === oNotifier.getId()) {
					// clone the message array to sort it
					fnSortMessages(this, this.getMessageNotifier());
				}

				if (fnChangeVisibility(this)) {
					var bShouldBeVisible = this.hasItems();
					this.fireDisplay({
						show : bShouldBeVisible
					});
				} else {
					/*
					 * Needed if i.e. all messages of a notifier were removed but if
					 * there are still notifications or messages to display
					 */
					this.invalidate();

					/*
					 * Needed if the message is directly removed from the Callout
					 * without any request to the user.
					 */
					if (oEvent.getParameter("type") === "removed") {
						/*
						 * Since the Callout has only one content - the NotifierView -
						 * it can be checked this way. If there is no content the
						 * Callout has been closed already.
						 */
						if (oCallout.getContent().length > 0) {
							var oNotiView = oCallout.getContent()[0];
							var oMessage = oEvent.getParameter("message");

							var aMessageViews = oNotiView.getMessages();
							var tmpMsgView;

							for (var i = 0; i < aMessageViews.length; i++) {
								tmpMsgView = aMessageViews[i];

								if (oMessage.getId() === tmpMsgView._message.getId()) {
									tmpMsgView.destroy();

									/*
									 * A normal invalidate on the NotifierView
									 * doesn't work here since the invalidate is
									 * delegated to the most upper parent -> the
									 * NotificationBar. If the NotificationBar is
									 * rendered it doesn't know something of the
									 * corresponding Callout. It would be possible
									 * to rerender the NotifierView but since the
									 * height of the Callout is reduced the
									 * Callout's position must be fixed as well.
									 * This happens also when the Callout is
									 * rerendered, so it saves some lines of codes
									 * to rerender the Callout itself.
									 */
									oCallout.rerender();

									/*
									 * An open Callout would loose its correct
									 * position due to the re-rendering. The
									 * followOf-functionality of the Popup doesn't
									 * work here, since the opener hasn't moved. See
									 * CSN 1625930 2013
									 */
									oCallout.adjustPosition();
									break;
								}
							}
						}
					}
				}

				break;

			case "openCallout":
				oCallout.destroyContent();

				var oNotifier = oEvent.getParameter("notifier");
				// destroy (renew) views that were previously created in maximized
				// mode
				oNotifier.destroyAggregation("views", true);
				var sId = oNotifier.getId();

				var oMessageNotifier = this.getMessageNotifier();

				if (oMessageNotifier && sId === oMessageNotifier.getId()) {
					sId += "-messageNotifierView";
				} else {
					sId += "-messageView";
				}

				// create control that renders the notifier's messages
				var oNotifierView = new NotificationBar.NotifierView(sId, {
					title : oNotifier.getTitle(),
					visibleItems : this._visibleItems
				});

				if (oNotifier._bEnableMessageSelect) {
					oNotifierView.addStyleClass("sapUiNotifierSelectable");
				}

				var aMessages = oNotifier.getMessages();
				for (var i = 0; i < aMessages.length; i++) {
					var oView = fnCreateMessageView(aMessages[i], oNotifier, this);
					oNotifierView.addMessage(oView);
				}

				// with adding this aggregation the view is destroyed as well if
				// needed
				oNotifier.addAggregation("views", oNotifierView, true);

				oCallout.addContent(oNotifierView);
				break;
			}
		}
function ( oEvent ) { var oCallout = oEvent . getParameter ( "callout" ) ; switch ( oEvent . getParameter ( "type" ) ) { case "added" : case "removed" : var oNotifier = oEvent . getParameter ( "notifier" ) ; if ( this . getMessageNotifier ( ) && this . getMessageNotifier ( ) . getId ( ) === oNotifier . getId ( ) ) { // clone the message array to sort it fnSortMessages ( this , this . getMessageNotifier ( ) ) ; } if ( fnChangeVisibility ( this ) ) { var bShouldBeVisible = this . hasItems ( ) ; this . fireDisplay ( { show : bShouldBeVisible } ) ; } else { /*
					 * Needed if i.e. all messages of a notifier were removed but if
					 * there are still notifications or messages to display
					 */ this . invalidate ( ) ; /*
					 * Needed if the message is directly removed from the Callout
					 * without any request to the user.
					 */ if ( oEvent . getParameter ( "type" ) === "removed" ) { /*
						 * Since the Callout has only one content - the NotifierView -
						 * it can be checked this way. If there is no content the
						 * Callout has been closed already.
						 */ if ( oCallout . getContent ( ) . length > 0 ) { var oNotiView = oCallout . getContent ( ) [ 0 ] ; var oMessage = oEvent . getParameter ( "message" ) ; var aMessageViews = oNotiView . getMessages ( ) ; var tmpMsgView ; for ( var i = 0 ; i < aMessageViews . length ; i ++ ) { tmpMsgView = aMessageViews [ i ] ; if ( oMessage . getId ( ) === tmpMsgView . _message . getId ( ) ) { tmpMsgView . destroy ( ) ; /*
									 * A normal invalidate on the NotifierView
									 * doesn't work here since the invalidate is
									 * delegated to the most upper parent -> the
									 * NotificationBar. If the NotificationBar is
									 * rendered it doesn't know something of the
									 * corresponding Callout. It would be possible
									 * to rerender the NotifierView but since the
									 * height of the Callout is reduced the
									 * Callout's position must be fixed as well.
									 * This happens also when the Callout is
									 * rerendered, so it saves some lines of codes
									 * to rerender the Callout itself.
									 */ oCallout . rerender ( ) ; /*
									 * An open Callout would loose its correct
									 * position due to the re-rendering. The
									 * followOf-functionality of the Popup doesn't
									 * work here, since the opener hasn't moved. See
									 * CSN 1625930 2013
									 */ oCallout . adjustPosition ( ) ; break ; } } } } } break ; case "openCallout" : oCallout . destroyContent ( ) ; var oNotifier = oEvent . getParameter ( "notifier" ) ; // destroy (renew) views that were previously created in maximized // mode oNotifier . destroyAggregation ( "views" , true ) ; var sId = oNotifier . getId ( ) ; var oMessageNotifier = this . getMessageNotifier ( ) ; if ( oMessageNotifier && sId === oMessageNotifier . getId ( ) ) { sId += "-messageNotifierView" ; } else { sId += "-messageView" ; } // create control that renders the notifier's messages var oNotifierView = new NotificationBar . NotifierView ( sId , { title : oNotifier . getTitle ( ) , visibleItems : this . _visibleItems } ) ; if ( oNotifier . _bEnableMessageSelect ) { oNotifierView . addStyleClass ( "sapUiNotifierSelectable" ) ; } var aMessages = oNotifier . getMessages ( ) ; for ( var i = 0 ; i < aMessages . length ; i ++ ) { var oView = fnCreateMessageView ( aMessages [ i ] , oNotifier , this ) ; oNotifierView . addMessage ( oView ) ; } // with adding this aggregation the view is destroyed as well if // needed oNotifier . addAggregation ( "views" , oNotifierView , true ) ; oCallout . addContent ( oNotifierView ) ; break ; } }
This is the eventListener of the NotificationBar. All triggered events
from the bar's notifiers will be caught here.

@param {sap.ui.base.Event}
oEvent the event will all needed stuff. It can contain
'added', 'removed' or 'openCallout' as a parameter to identify
the event.
This is the eventListener of the NotificationBar . All triggered events from the bar s notifiers will be caught here .