Class sap.ui.core.MessageModule: sap/ui/core/Message

extends Element

This element used to provide messages. Rendering must be done within the control that uses this kind of element.

Its default level is none.

Constructor Summary
new sap.ui.core.Message(sId?, mSettings?)Constructor for a new Message.
Method Summary
sap.ui.core.Message.compareByType(oMessage1, oMessage2)Compares two given messages with each other.
sap.ui.core.Message.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.Message with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.Message.getMetadata()Returns a metadata object for class sap.ui.core.Message.
compareByType(oOther)Compares the given message with this message.
getDefaultIcon(sSize)Returns the icon's default URI depending on given size.
getIcon()Gets current value of property icon.
getLevel()Gets current value of property level.
getReadOnly()Gets current value of property readOnly.
getText()Gets current value of property text.
getTimestamp()Gets current value of property timestamp.
setIcon(sIcon)Sets a new value for property icon.
setLevel(sLevel)Sets a new value for property level.
setReadOnly(bReadOnly)Sets a new value for property readOnly.
setText(sText)Sets a new value for property text.
setTimestamp(sTimestamp)Sets a new value for property timestamp.
Constructor Detail
new sap.ui.core.Message(sId?, mSettings?)
Constructor for a new Message.

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.Element 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
Method Detail
sap.ui.core.Message.compareByType(oMessage1, oMessage2): int
Compares two given messages with each other.

The types of sap.ui.core.MessageType are ordered from "Error" > "Warning" > "Success" > "Information" > "None".

Parameters:
{sap.ui.core.Message}oMessage1 first message to compare
{sap.ui.core.Message}oMessage2 second message to compare
Returns:
{int} returns 0 if both messages are at the same level. -1 if this message has a lower level. 1 if this message has a higher level.
sap.ui.core.Message.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.Message 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.Element.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.core.Message.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.Message.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
compareByType(oOther): int
Compares the given message with this message. The types of sap.ui.core.MessageType are ordered from "Error" > "Warning" > "Success" > "Information" > "None".

See sap.ui.core.Message.compareByType

Parameters:
{sap.ui.core.Message}oOther message to compare with this one
Returns:
{int} returns 0 if both messages are at the same level. -1 if this message has a lower level. 1 if this message has a higher level.
getDefaultIcon(sSize): sap.ui.core.URI
Returns the icon's default URI depending on given size.

There are default icons for messages available that can be used this way. If no parameter is given, the size will be 16x16 per default. If larger icons are needed, the parameter "32x32" might be given.

Parameters:
{string}sSize If parameter is not set the default icon's size will be 16x16. If parameter is set to "32x32" the icon size will be 32x32.
Returns:
{sap.ui.core.URI} URI of the default icon.
getIcon(): sap.ui.core.URI
Gets current value of property icon.

A possible icon URI of the message

Returns:
{sap.ui.core.URI} Value of property icon
Gets current value of property level.

Setting the message's level.

Default value is None.

Returns:
{sap.ui.core.MessageType} Value of property level
getReadOnly(): boolean
Gets current value of property readOnly.

Determines whether the message should be read only. This helps the application to handle a message a different way if the application differentiates between read-only and common messages.

Default value is false.

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

Message text

Returns:
{string} Value of property text
getTimestamp(): string
Gets current value of property timestamp.

Message's timestamp. It is just a simple String that will be used without any transformation. So the application that uses messages needs to format the timestamp to its own needs.

Returns:
{string} Value of property timestamp
setIcon(sIcon): sap.ui.core.Message
Sets a new value for property icon.

A possible icon URI of the message

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

Parameters:
{sap.ui.core.URI}sIcon New value for property icon
Returns:
{sap.ui.core.Message} Reference to this in order to allow method chaining
setLevel(sLevel): sap.ui.core.Message
Sets a new value for property level.

Setting the message's level.

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

Default value is None.

Parameters:
{sap.ui.core.MessageType}sLevel New value for property level
Returns:
{sap.ui.core.Message} Reference to this in order to allow method chaining
setReadOnly(bReadOnly): sap.ui.core.Message
Sets a new value for property readOnly.

Determines whether the message should be read only. This helps the application to handle a message a different way if the application differentiates between read-only and common messages.

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

Default value is false.

Parameters:
{boolean}bReadOnly New value for property readOnly
Since:
1.19.0
Returns:
{sap.ui.core.Message} Reference to this in order to allow method chaining
setText(sText): sap.ui.core.Message
Sets a new value for property text.

Message text

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

Parameters:
{string}sText New value for property text
Returns:
{sap.ui.core.Message} Reference to this in order to allow method chaining
setTimestamp(sTimestamp): sap.ui.core.Message
Sets a new value for property timestamp.

Message's timestamp. It is just a simple String that will be used without any transformation. So the application that uses messages needs to format the timestamp to its own needs.

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

Parameters:
{string}sTimestamp New value for property timestamp
Returns:
{sap.ui.core.Message} Reference to this in order to allow method chaining