Class sap.ui.commons.MessageBarModule: sap/ui/commons/MessageBar

extends Control

Creates an instance of a MessageBar Control, for displaying messages.

Deprecated API:Since version 1.4.0. Instead, use the sap.m.MessagePopover control.

Constructor Summary
new sap.ui.commons.MessageBar(sId?, mSettings?)Constructor for a new MessageBar.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.MessageBar.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.MessageBar with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.MessageBar.getMetadata()Returns a metadata object for class sap.ui.commons.MessageBar.
addMessages(aAMessages)Adds/updates a supplied list of messages.
deleteAllMessages()Deletes all messages.
deleteMessages(aIds)Deletes a supplied list of messages.
getAnchorID()Gets current value of property anchorID.
getAnchorSnapPoint()Gets current value of property anchorSnapPoint.
getMaxListed()Gets current value of property maxListed.
getMaxToasted()Gets current value of property maxToasted.
getVisible()Gets current value of property visible.
setAnchorID(sAnchorID)Sets a new value for property anchorID.
setAnchorSnapPoint(sAnchorSnapPoint)Sets a new value for property anchorSnapPoint.
setMaxListed(iMaxListed)Sets a new value for property maxListed.
setMaxToasted(iMaxToasted)Sets a new value for property maxToasted.
setVisible(bVisible)Setter for property visible.
Constructor Detail
new sap.ui.commons.MessageBar(sId?, mSettings?)
Constructor for a new MessageBar.

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:

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.4.0. Instead, use the sap.m.MessagePopover control.
Method Detail
sap.ui.commons.MessageBar.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.MessageBar 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.commons.MessageBar.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.MessageBar.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addMessages(aAMessages): void
Adds/updates a supplied list of messages. The MessageBar will appear if at least one message exists.
Parameters:
{sap.ui.commons.Message[]}aAMessages Array of messages.
deleteAllMessages(): sap.ui.commons.MessageBar
Deletes all messages.
Returns:
{sap.ui.commons.MessageBar}this to allow method chaining
deleteMessages(aIds): void
Deletes a supplied list of messages. The MessageBar will disappear when no message remains.
Parameters:
{string[]}aIds Messages IDs to be deleted.
getAnchorID(): string
Gets current value of property anchorID.

Element ID upon which the MessageBar will be initially positioned.

Default value is .

Returns:
{string} Value of property anchorID
getAnchorSnapPoint(): string
Gets current value of property anchorSnapPoint.

Type: sap.ui.core.Popup.Dock SnapPoint of MessageBar over anchorId. Note: Use "begin" or "end" for RTL support. Note: "center" is not indicated, as positioning is only set once, either via the css "left" or the "right" attribute. Therefore a MessageBar will only be extended in one direction, as Messages come in.

Default value is begin top.

Returns:
{string} Value of property anchorSnapPoint
getMaxListed(): int
Gets current value of property maxListed.

Maximum number of messages being displayed in the List before a scrollbar appears. Value '0' means no limit.

Default value is 7.

Returns:
{int} Value of property maxListed
getMaxToasted(): int
Gets current value of property maxToasted.

Maximum number of simultaneous messages being toasted in a row. Value '0' means this dynamic part is switched off.

Default value is 3.

Returns:
{int} Value of property maxToasted
getVisible(): boolean
Gets current value of property visible.

Specifies whether or not the MessageBar is visible. Invisible controls are not rendered.

Default value is true.

Returns:
{boolean} Value of property visible
setAnchorID(sAnchorID): sap.ui.commons.MessageBar
Sets a new value for property anchorID.

Element ID upon which the MessageBar will be initially positioned.

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

Default value is .

Parameters:
{string}sAnchorID New value for property anchorID
Returns:
{sap.ui.commons.MessageBar} Reference to this in order to allow method chaining
setAnchorSnapPoint(sAnchorSnapPoint): sap.ui.commons.MessageBar
Sets a new value for property anchorSnapPoint.

Type: sap.ui.core.Popup.Dock SnapPoint of MessageBar over anchorId. Note: Use "begin" or "end" for RTL support. Note: "center" is not indicated, as positioning is only set once, either via the css "left" or the "right" attribute. Therefore a MessageBar will only be extended in one direction, as Messages come in.

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

Default value is begin top.

Parameters:
{string}sAnchorSnapPoint New value for property anchorSnapPoint
Returns:
{sap.ui.commons.MessageBar} Reference to this in order to allow method chaining
setMaxListed(iMaxListed): sap.ui.commons.MessageBar
Sets a new value for property maxListed.

Maximum number of messages being displayed in the List before a scrollbar appears. Value '0' means no limit.

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

Default value is 7.

Parameters:
{int}iMaxListed New value for property maxListed
Returns:
{sap.ui.commons.MessageBar} Reference to this in order to allow method chaining
setMaxToasted(iMaxToasted): sap.ui.commons.MessageBar
Sets a new value for property maxToasted.

Maximum number of simultaneous messages being toasted in a row. Value '0' means this dynamic part is switched off.

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

Default value is 3.

Parameters:
{int}iMaxToasted New value for property maxToasted
Returns:
{sap.ui.commons.MessageBar} Reference to this in order to allow method chaining
setVisible(bVisible): sap.ui.commons.MessageBar
Setter for property visible.

Default value is true

The default implementation of function setVisible() is enhanced in order to toggle the visibility:hidden; attribute over the control.

Parameters:
{boolean}bVisible New value for property visible
Returns:
{sap.ui.commons.MessageBar}this to allow method chaining