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

extends Control

Creates the "Message"s to be supplied to the "MessageBar" Control.

Deprecated API:Since version 1.4.0. A new messaging concept will be created in future. Therefore this control might be removed in one of the next versions.

Constructor Summary
new sap.ui.commons.Message(sId?, mSettings?)Constructor for a new Message.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.Message.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.Message with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.Message.getMetadata()Returns a metadata object for class sap.ui.commons.Message.
bindDetails(fnCallBack)Registers a callback function to be invoked if long text Details are to be made available.
getAssociatedElementId()Gets current value of property associatedElementId.
getDesign()Gets current value of property design.
getText()Gets current value of property text.
getType()Gets current value of property type.
setAssociatedElementId(sAssociatedElementId)Sets a new value for property associatedElementId.
setDesign(sDesign)Sets a new value for property design.
setText(sText)Sets a new value for property text.
setType(sType)Sets a new value for property type.
Constructor Detail
new sap.ui.commons.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.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. A new messaging concept will be created in future. Therefore this control might be removed in one of the next versions.
Method Detail
sap.ui.commons.Message.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.commons.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.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.Message.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.Message.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
bindDetails(fnCallBack)
Registers a callback function to be invoked if long text Details are to be made available.

This callback function will be supplied the corresponding Message "id", and should return the (simple) HTML string to be displayed within the Message Details Dialog.

E.g.: myMessage.bindDetails(getDetails); function getDetails(sId) {... return htmlString;}

Parameters:
{function}fnCallBack the callback function
getAssociatedElementId(): string
Gets current value of property associatedElementId.

Associated UI element ID. (Optional) For navigation to error field.

Returns:
{string} Value of property associatedElementId
getDesign(): string
Gets current value of property design.

Internal attribute, used to force the display of the "short" or the "long" text only.

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

Message short text. (Mandatory)

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

"Success", or "Warning", or "Error" messages. (Mandatory)

Returns:
{sap.ui.commons.MessageType} Value of property type
setAssociatedElementId(sAssociatedElementId): sap.ui.commons.Message
Sets a new value for property associatedElementId.

Associated UI element ID. (Optional) For navigation to error field.

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

Parameters:
{string}sAssociatedElementId New value for property associatedElementId
Returns:
{sap.ui.commons.Message} Reference to this in order to allow method chaining
setDesign(sDesign): sap.ui.commons.Message
Sets a new value for property design.

Internal attribute, used to force the display of the "short" or the "long" text only.

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

Parameters:
{string}sDesign New value for property design
Returns:
{sap.ui.commons.Message} Reference to this in order to allow method chaining
setText(sText): sap.ui.commons.Message
Sets a new value for property text.

Message short text. (Mandatory)

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.commons.Message} Reference to this in order to allow method chaining
setType(sType): sap.ui.commons.Message
Sets a new value for property type.

"Success", or "Warning", or "Error" messages. (Mandatory)

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

Parameters:
{sap.ui.commons.MessageType}sType New value for property type
Returns:
{sap.ui.commons.Message} Reference to this in order to allow method chaining