class sap.ui.core.message.Message

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/message/Message
Application Component: CA-UI5-COR

Constructor

Constructor for a new Message.

new sap.ui.core.message.Message(mParameters?)
Param Type Default Value Description
mParameters? object

a map which contains the following parameter properties:

id? string

The message id: will be generated if no id is set

message? string

The message text

description? string

The message description

descriptionUrl? string

The message description url to get a more detailed message

additionalText? string

The message additionalText

type? sap.ui.core.MessageType sap.ui.core.MessageType.None

The message type

code? string

The message code

technical? boolean false

If the message is set as technical message

technicalDetails? object

An object containing technical details for a message

processor? sap.ui.core.message.MessageProcessor
target? string string[]

The single message target or (since 1.79) an array of message targets in case the message has multiple targets. The syntax is MessageProcessor dependent. Read the documentation of the respective MessageProcessor.

persistent? boolean false

Sets message persistent: If persistent is set true the message lifecycle is controlled by the application

date? int Date.now()

Sets message date which can be used to remove old messages. Number of milliseconds elapsed since 1 January 1970 00:00:00 UTC

fullTarget? string string[] ""

Defines more detailed information about the message target or (since 1.79) the message targets in case the message has multiple targets. This property is currently only used by the ODataMessageParser.


Methods Overview

Method Description
sap.ui.core.message.Message.extend

Creates a new subclass of class sap.ui.core.message.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.base.Object.extend.

getAdditionalText

Returns the messages additional text.

getCode

Returns the message code

getControlId

Returns the control ID if set.

NOTE: The control ID is only set for Controls based on sap.m.InputBase The Control must be bound to a Model so the Message could be propagated to this Control. The propagation happens only if the Control is created and visible on the screen. Is this the case the control ID is set. The ID is not set in all other cases and cannot be set manually.

If a Message is propagated to multiple Controls bound to the same target the last Control wins.

getControlIds

Returns an array of control IDs.

NOTE: The control ID is only set for Controls based on sap.m.InputBase. The Control must be bound to a Model so the Message could be propagated to this Control. The propagation happens only if the Control is created and visible on the screen. The ID is not set in all other cases and cannot be set manually.

getDate

Set the date of the message

getDescription

Returns the message description

getDescriptionUrl

Returns the message description URL which should be used to download the description content

getId

Returns the Message Id

getMessage

Returns message text

getMessageProcessor

Returns the message processor

sap.ui.core.message.Message.getMetadata

Returns a metadata object for class sap.ui.core.message.Message.

getPersistent

Returns the if Message is persistent

getTarget

Returns the message target or the first target if the message has multiple targets.

Since As a message may have multiple targets, use {@link #getTargets} instead
getTargets

Returns the targets of this message.

getTechnical

Returns the if Message set as technical message

getTechnicalDetails

Returns the technical details of the message

getType

Returns the message type

setAdditionalText

Sets the additionaltext for the message or merge different additionaltext strings

setCode

Set message code

setDate

Set the date of the message, this will automatically be set on message creation

setDescription

Set message description

setDescriptionUrl

Set message description URL which should be used to download the description content

setMessage

Set message text

setMessageProcessor

Set message processor

setPersistent

Set message persistent

setTarget

Sets the message target; in case the message has multiple targets, sets the first target of the message. The syntax is MessageProcessor dependent. See the documentation of the respective MessageProcessor.

Since As a message may have multiple targets, use {@link #setTargets} instead
setTargets

Sets the targets of this message.

setTechnical

Set message as technical message

setTechnicalDetails

Set the technical details for the message

setType

Set message type

sap.ui.core.message.Message.extend

Creates a new subclass of class sap.ui.core.message.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.base.Object.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

getAdditionalText

Returns the messages additional text.

getCode

Returns the message code

getControlId

Returns the control ID if set.

NOTE: The control ID is only set for Controls based on sap.m.InputBase The Control must be bound to a Model so the Message could be propagated to this Control. The propagation happens only if the Control is created and visible on the screen. Is this the case the control ID is set. The ID is not set in all other cases and cannot be set manually.

If a Message is propagated to multiple Controls bound to the same target the last Control wins.

getControlIds

Returns an array of control IDs.

NOTE: The control ID is only set for Controls based on sap.m.InputBase. The Control must be bound to a Model so the Message could be propagated to this Control. The propagation happens only if the Control is created and visible on the screen. The ID is not set in all other cases and cannot be set manually.

getDate

Set the date of the message

getDescription

Returns the message description

getDescriptionUrl

Returns the message description URL which should be used to download the description content

getId

Returns the Message Id

getMessage

Returns message text

getMessageProcessor

Returns the message processor

sap.ui.core.message.Message.getMetadata

Returns a metadata object for class sap.ui.core.message.Message.

getPersistent

Returns the if Message is persistent

getTarget

Returns the message target or the first target if the message has multiple targets.

Since As a message may have multiple targets, use {@link #getTargets} instead

getTargets

Returns the targets of this message.

getTechnical

Returns the if Message set as technical message

getTechnicalDetails

Returns the technical details of the message

getType

Returns the message type

setAdditionalText

Sets the additionaltext for the message or merge different additionaltext strings

Param Type DefaultValue Description
sAdditionalText string

The additionaltext.

setCode

Set message code

Param Type DefaultValue Description
sCode string

The Message code

setDate

Set the date of the message, this will automatically be set on message creation

Param Type DefaultValue Description
iDate int

The message date in number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. As returned by Date.now().

setDescription

Set message description

Param Type DefaultValue Description
sDescription string

The Message description

setDescriptionUrl

Set message description URL which should be used to download the description content

Param Type DefaultValue Description
sDescriptionUrl string

The URL pointing to the description long text

setMessage

Set message text

Param Type DefaultValue Description
sMessage string

The Message as text

setMessageProcessor

Set message processor

Param Type DefaultValue Description
oMessageProcessor sap.ui.core.message.MessageProcessor

The Message processor

setPersistent

Set message persistent

Param Type DefaultValue Description
bPersistent boolean

Set Message persistent: If persisten is set true the message lifecycle controlled by Application

setTarget

Sets the message target; in case the message has multiple targets, sets the first target of the message. The syntax is MessageProcessor dependent. See the documentation of the respective MessageProcessor.

Since As a message may have multiple targets, use {@link #setTargets} instead
Param Type DefaultValue Description
sTarget string

The message target

setTargets

Sets the targets of this message.

Param Type DefaultValue Description
aNewTargets string[]

The new targets of this message; use an empty array if the message shall have no targets

setTechnical

Set message as technical message

Param Type DefaultValue Description
bTechnical boolean

Set Message as technical message lifecycle controlled by Application

setTechnicalDetails

Set the technical details for the message

Param Type DefaultValue Description
oTechnicalDetails object

The technical details of the message

setType

Set message type

Param Type DefaultValue Description
sType sap.ui.core.MessageType

The Message type