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(mParameters?)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:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Event Detail
close(oControlEvent)
This event will be fired after the container is closed.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.m.MessageStrip.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.MessageStrip.
Returns:
sap.ui.base.MetadataMetadata 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:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.m.MessageStrip itself
Returns:
sap.m.MessageStripReference 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.
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:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.m.MessageStripReference to this in order to allow method chaining
fireClose(mParameters?): sap.m.MessageStrip
Fires event close to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
Returns:
sap.m.MessageStripReference 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.URIValue of property customIcon
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:
booleanValue 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:
booleanValue of property showIcon
getText(): string

Gets current value of property text.

Determines the text of the message.

Default value is .

Returns:
stringValue 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.MessageTypeValue 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.URIsCustomIconNew value for property customIcon
Returns:
sap.m.MessageStripReference 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:
booleanbShowCloseButtonNew value for property showCloseButton
Returns:
sap.m.MessageStripReference 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:
booleanbShowIconNew value for property showIcon
Returns:
sap.m.MessageStripReference to this in order to allow method chaining
setText(sText): sap.m.MessageStrip
Setter for property text. Default value is empty/undefined
Parameters:
stringsTextnew value for property text
Returns:
sap.m.MessageStripthis 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.MessageTypesTypeThe Message type
Returns:
sap.m.MessageStripthis to allow method chaining