Class sap.m.MessageStripModule: sap/m/MessageStrip

extends Control

MessageStrip is a control that enables the embedding of application-related messages in the application. There are 4 types of messages: Information, Success, Warning and Error. Each message can have a close button, so that it can be removed from the UI if needed.


Since: 1.30.
Constructor Summary
new sap.m.MessageStrip(sId?, mSettings?)Constructor for a new MessageStrip.
Event Summary
close(oControlEvent)This event will be fired after the container is closed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.MessageStrip.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.MessageStrip with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.MessageStrip.getMetadata()Returns a metadata object for class sap.m.MessageStrip.
attachClose(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the close event of this sap.m.MessageStrip.
close()Closes the MessageStrip.
destroyLink()Destroys the link in the aggregation link.
detachClose(fnFunction, oListener)Detaches event handler fnFunction from the close event of this sap.m.MessageStrip.
fireClose(mArguments?)Fires event close to attached listeners.
getCustomIcon()Gets current value of property customIcon.
getLink()Gets content of aggregation link.
getShowCloseButton()Gets current value of property showCloseButton.
getShowIcon()Gets current value of property showIcon.
getText()Gets current value of property text.
getType()Gets current value of property type.
setCustomIcon(sCustomIcon)Sets a new value for property customIcon.
setLink(oLink)Sets the aggregated link.
setShowCloseButton(bShowCloseButton)Sets a new value for property showCloseButton.
setShowIcon(bShowIcon)Sets a new value for property showIcon.
setText(sText)Setter for property text.
setType(sType)Setter for property type.
Constructor Detail
new sap.m.MessageStrip(sId?, mSettings?)
Constructor for a new MessageStrip.

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
    • link : sap.m.Link (default)
  • Events
    • close : 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
Event Detail
close(oControlEvent)
This event will be fired after the container is closed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.m.MessageStrip.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.MessageStrip 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.m.MessageStrip.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.MessageStrip.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
attachClose(oData?, fnFunction, oListener?): sap.m.MessageStrip
Attaches event handler fnFunction to the close event of this sap.m.MessageStrip.

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.m.MessageStrip itself.

This event will be fired after the container is closed.

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.m.MessageStrip itself
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
close(): void
Closes the MessageStrip. This method sets the visible property of the MessageStrip to false. The MessageStrip can be shown again by setting the visible property to true.
destroyLink(): sap.m.MessageStrip
Destroys the link in the aggregation link.
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
detachClose(fnFunction, oListener): sap.m.MessageStrip
Detaches event handler fnFunction from the close event of this sap.m.MessageStrip.

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.m.MessageStrip} Reference to this in order to allow method chaining
fireClose(mArguments?): sap.m.MessageStrip
Fires event close to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
getCustomIcon(): sap.ui.core.URI
Gets current value of property customIcon.

Determines a custom icon which is displayed. If none is set, the default icon for this message type is used.

Default value is .

Returns:
{sap.ui.core.URI} Value of property customIcon
getLink(): sap.m.Link
Gets content of aggregation link.

Adds a sap.m.Link control which will be displayed at the end of the message.

Returns:
{sap.m.Link}
getShowCloseButton(): boolean
Gets current value of property showCloseButton.

Determines if the message has a close button in the upper right corner.

Default value is false.

Returns:
{boolean} Value of property showCloseButton
getShowIcon(): boolean
Gets current value of property showIcon.

Determines if an icon is displayed for the message.

Default value is false.

Returns:
{boolean} Value of property showIcon
getText(): string
Gets current value of property text.

Determines the text of the message.

Default value is .

Returns:
{string} Value of property text
Gets current value of property type.

Determines the type of messages that are displayed in the MessageStrip. Possible values are: Information (default), Success, Warning, Error. If None is passed, the value is set to Information and a warning is displayed in the console.

Default value is Information.

Returns:
{sap.ui.core.MessageType} Value of property type
setCustomIcon(sCustomIcon): sap.m.MessageStrip
Sets a new value for property customIcon.

Determines a custom icon which is displayed. If none is set, the default icon for this message type is used.

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

Default value is .

Parameters:
{sap.ui.core.URI}sCustomIcon New value for property customIcon
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
setLink(oLink): sap.m.MessageStrip
Sets the aggregated link.
Parameters:
{sap.m.Link}oLink The link to set
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
setShowCloseButton(bShowCloseButton): sap.m.MessageStrip
Sets a new value for property showCloseButton.

Determines if the message has a close button in the upper right corner.

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

Default value is false.

Parameters:
{boolean}bShowCloseButton New value for property showCloseButton
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
setShowIcon(bShowIcon): sap.m.MessageStrip
Sets a new value for property showIcon.

Determines if an icon is displayed for the message.

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

Default value is false.

Parameters:
{boolean}bShowIcon New value for property showIcon
Returns:
{sap.m.MessageStrip} Reference to this in order to allow method chaining
setText(sText): sap.m.MessageStrip
Setter for property text. Default value is empty/undefined
Parameters:
{string}sText new value for property text
Returns:
{sap.m.MessageStrip} this to allow method chaining
setType(sType): sap.m.MessageStrip
Setter for property type. Default value is sap.ui.core.MessageType.Information
Parameters:
{sap.ui.core.MessageType}sType The Message type
Returns:
{sap.m.MessageStrip} this to allow method chaining