Creates an instance of a MessageBar Control, for displaying messages.
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#constructor for a general description of the syntax of the settings object.
new sap.ui.commons.MessageBar(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 |
---|---|---|---|
anchorID | string | empty string | Element ID upon which the MessageBar will be initially positioned. Visibility: public |
anchorSnapPoint | string | begin top | 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. Visibility: public |
maxListed | int | 7 | Maximum number of messages being displayed in the List before a scrollbar appears. Value '0' means no limit. Visibility: public |
maxToasted | int | 3 | Maximum number of simultaneous messages being toasted in a row. Value '0' means this dynamic part is switched off. Visibility: public |
visible | boolean | true | Specifies whether or not the MessageBar is visible. Invisible controls are not rendered. Visibility: public |
Method | Description |
---|---|
addMessages |
Adds/updates a supplied list of messages. The MessageBar will appear if at least one message exists. |
deleteAllMessages |
Deletes all messages. |
deleteMessages |
Deletes a supplied list of messages. The MessageBar will disappear when no message remains. |
sap.ui.commons.MessageBar.extend |
Creates a new subclass of class sap.ui.commons.MessageBar with name
|
getAnchorID |
Gets current value of property anchorID. Element ID upon which the MessageBar will be initially positioned. Default value is |
getAnchorSnapPoint |
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 |
getMaxListed |
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 |
getMaxToasted |
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 |
sap.ui.commons.MessageBar.getMetadata |
Returns a metadata object for class sap.ui.commons.MessageBar. |
getVisible |
Gets current value of property visible. Specifies whether or not the MessageBar is visible. Invisible controls are not rendered. Default value is |
setAnchorID |
Sets a new value for property anchorID. Element ID upon which the MessageBar will be initially positioned. When called with a value of Default value is |
setAnchorSnapPoint |
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 Default value is |
setMaxListed |
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 Default value is |
setMaxToasted |
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 Default value is |
setVisible |
Setter for property Default value is The default implementation of function |
Adds/updates a supplied list of messages. The MessageBar will appear if at least one message exists.
Param | Type | DefaultValue | Description |
---|---|---|---|
aAMessages | sap.ui.commons.Message[] |
Array of messages. |
Deletes a supplied list of messages. The MessageBar will disappear when no message remains.
Param | Type | DefaultValue | Description |
---|---|---|---|
aIds | string[] |
Messages IDs to be deleted. |
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.
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 |
Gets current value of property anchorID.
Element ID upon which the MessageBar will be initially positioned.
Default value is empty 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"
.
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
.
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 a metadata object for class sap.ui.commons.MessageBar.
Gets current value of property visible.
Specifies whether or not the MessageBar is visible. Invisible controls are not rendered.
Default value is true
.
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 empty string
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAnchorID | string | '' |
New value for property |
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"
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAnchorSnapPoint | string | "begin top" |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iMaxListed | int | 7 |
New value for property |
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
.
Param | Type | DefaultValue | Description |
---|---|---|---|
iMaxToasted | int | 3 |
New value for property |