class sap.m.MessagePage

Control sample: sap.m.MessagePage
Visiblity: public
UX Guidelines: Message Page
Implements:
Available since: N/A
Module: sap/m/MessagePage
Application Component: CA-UI5-CTR

Displays an empty page with an icon and a header when certain conditions are met.

Overview

MessagePage is displayed when there is no data or matching content. There are different use cases where a MessagePage might be visualized, for example:

The layout is unchanged but the text and icon vary depending on the use case.

Usage

Note: The MessagePage is not intended to be used as a top-level control, but rather used within controls such as NavContainer, App, Shell or other container controls.


Constructor

Constructor for a new MessagePage.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.m.MessagePage(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
description string Check the filter settings.

Determines the detailed description that shows additional information on the MessagePage.

Visibility: public
enableFormattedText boolean false

Defines whether the value set in the description property is displayed as formatted text in HTML format.

For details regarding supported HTML tags, see sap.m.FormattedText

Since: 1.54.

Visibility: public
icon sap.ui.core.URI sap-icon://documents

Determines the icon displayed on the MessagePage.

Visibility: public
iconAlt string

Defines the alt attribute of the icon displayed on the MessagePage.

Since: 1.52.

Visibility: public
showHeader boolean true

Determines the visibility of the MessagePage header. Can be used to hide the header of the MessagePage when it's embedded in another page.

Visibility: public
showNavButton boolean false

Determines the visibility of the navigation button in MessagePage header.

Visibility: public
text string No matching items found.

Determines the main text displayed on the MessagePage.

Visibility: public
textDirection sap.ui.core.TextDirection Inherit

Determines the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

Visibility: public
title string

Determines the title in the header of MessagePage.

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_description 0..1 sap.m.Text

The description displayed under the text when enableFormattedText is false.

_formattedText 0..1 sap.m.FormattedText

The formatted text which is used when enableFormattedText is true.

_internalHeader 0..1 sap.m.Bar

A header bar which is managed internally by the MessagePage control.

_text 0..1 sap.m.Text

The text displayed under the icon.

buttons 0..n sap.m.Button

The buttons displayed under the description text.

Note: Buttons added to this aggregation are both vertically and horizontally centered. Depending on the available space, they may be rendered on several lines.

Since: 1.54.

customDescription 0..1 sap.m.Link

The (optional) custom description control of this page. Use this aggregation when the "description" (sap.m.Text) control needs to be replaced with an sap.m.Link control. "description" and "textDirection" setters can be used for this aggregation.

customText 0..1 sap.m.Link

The (optional) custom Text control of this page. Use this aggregation when the "text" (sap.m.Text) control needs to be replaced with an sap.m.Link control. "text" and "textDirection" setters can be used for this aggregation.


Associations

Name Cardinality Type Description
ariaDescribedBy 0..n sap.ui.core.Control

Association to controls / ids which describe this control (see WAI-ARIA attribute aria-describedby).

ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).


Events Overview

Event Description
navButtonPress

This event is fired when Nav Button is pressed.

Since: 1.28.1.

navButtonPress

This event is fired when Nav Button is pressed.

Since: 1.28.1.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

addButton

Adds some button to the aggregation buttons.

attachNavButtonPress

Attaches event handler fnFunction to the navButtonPress event of this sap.m.MessagePage.

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.MessagePage itself.

This event is fired when Nav Button is pressed.

destroyButtons

Destroys all the buttons in the aggregation buttons.

destroyCustomDescription

Destroys the customDescription in the aggregation customDescription.

destroyCustomText

Destroys the customText in the aggregation customText.

detachNavButtonPress

Detaches event handler fnFunction from the navButtonPress event of this sap.m.MessagePage.

The passed function and listener object must match the ones used for event registration.

sap.m.MessagePage.extend

Creates a new subclass of class sap.m.MessagePage 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.

fireNavButtonPress

Fires event navButtonPress to attached listeners.

getAriaDescribedBy

Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getButtons

Gets content of aggregation buttons.

The buttons displayed under the description text.

Note: Buttons added to this aggregation are both vertically and horizontally centered. Depending on the available space, they may be rendered on several lines.

getCustomDescription

Gets content of aggregation customDescription.

The (optional) custom description control of this page. Use this aggregation when the "description" (sap.m.Text) control needs to be replaced with an sap.m.Link control. "description" and "textDirection" setters can be used for this aggregation.

getCustomText

Gets content of aggregation customText.

The (optional) custom Text control of this page. Use this aggregation when the "text" (sap.m.Text) control needs to be replaced with an sap.m.Link control. "text" and "textDirection" setters can be used for this aggregation.

getDescription

Gets current value of property description.

Determines the detailed description that shows additional information on the MessagePage.

Default value is "Check the filter settings.".

getEnableFormattedText

Gets current value of property enableFormattedText.

Defines whether the value set in the description property is displayed as formatted text in HTML format.

For details regarding supported HTML tags, see sap.m.FormattedText

Default value is false.

getIcon

Gets current value of property icon.

Determines the icon displayed on the MessagePage.

Default value is "sap-icon://documents".

getIconAlt

Gets current value of property iconAlt.

Defines the alt attribute of the icon displayed on the MessagePage.

sap.m.MessagePage.getMetadata

Returns a metadata object for class sap.m.MessagePage.

getShowHeader

Gets current value of property showHeader.

Determines the visibility of the MessagePage header. Can be used to hide the header of the MessagePage when it's embedded in another page.

Default value is true.

getShowNavButton

Gets current value of property showNavButton.

Determines the visibility of the navigation button in MessagePage header.

Default value is false.

getText

Gets current value of property text.

Determines the main text displayed on the MessagePage.

Default value is "No matching items found.".

getTextDirection

Gets current value of property textDirection.

Determines the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

Default value is Inherit.

getTitle

Gets current value of property title.

Determines the title in the header of MessagePage.

indexOfButton

Checks for the provided sap.m.Button in the aggregation buttons. and returns its index if found or -1 otherwise.

insertButton

Inserts a button into the aggregation buttons.

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllButtons

Removes all the controls from the aggregation buttons.

Additionally, it unregisters them from the hosting UIArea.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

removeButton

Removes a button from the aggregation buttons.

setCustomDescription

Sets the aggregated customDescription.

setCustomText

Sets the aggregated customText.

setDescription

Sets a new value for property description.

Determines the detailed description that shows additional information on the MessagePage.

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

Default value is "Check the filter settings.".

setEnableFormattedText

Sets a new value for property enableFormattedText.

Defines whether the value set in the description property is displayed as formatted text in HTML format.

For details regarding supported HTML tags, see sap.m.FormattedText

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

Default value is false.

setIcon

Sets a new value for property icon.

Determines the icon displayed on the MessagePage.

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

Default value is "sap-icon://documents".

setIconAlt

Sets a new value for property iconAlt.

Defines the alt attribute of the icon displayed on the MessagePage.

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

setShowHeader

Sets a new value for property showHeader.

Determines the visibility of the MessagePage header. Can be used to hide the header of the MessagePage when it's embedded in another page.

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

Default value is true.

setShowNavButton

Sets a new value for property showNavButton.

Determines the visibility of the navigation button in MessagePage header.

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

Default value is false.

setText

Sets a new value for property text.

Determines the main text displayed on the MessagePage.

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

Default value is "No matching items found.".

setTextDirection

Sets a new value for property textDirection.

Determines the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

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

Default value is Inherit.

setTitle

Sets a new value for property title.

Determines the title in the header of MessagePage.

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

addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

Param Type DefaultValue Description
vAriaDescribedBy sap.ui.core.ID sap.ui.core.Control

The ariaDescribedBy to add; if empty, nothing is inserted

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

addButton

Adds some button to the aggregation buttons.

Param Type DefaultValue Description
oButton sap.m.Button

The button to add; if empty, nothing is inserted

attachNavButtonPress

Attaches event handler fnFunction to the navButtonPress event of this sap.m.MessagePage.

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.MessagePage itself.

This event is fired when Nav Button is pressed.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.MessagePage itself

destroyButtons

Destroys all the buttons in the aggregation buttons.

destroyCustomDescription

Destroys the customDescription in the aggregation customDescription.

destroyCustomText

Destroys the customText in the aggregation customText.

detachNavButtonPress

Detaches event handler fnFunction from the navButtonPress event of this sap.m.MessagePage.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.m.MessagePage.extend

Creates a new subclass of class sap.m.MessagePage 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.

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

fireNavButtonPress

Fires event navButtonPress to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAriaDescribedBy

Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.

getAriaLabelledBy

Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.

getButtons

Gets content of aggregation buttons.

The buttons displayed under the description text.

Note: Buttons added to this aggregation are both vertically and horizontally centered. Depending on the available space, they may be rendered on several lines.

getCustomDescription

Gets content of aggregation customDescription.

The (optional) custom description control of this page. Use this aggregation when the "description" (sap.m.Text) control needs to be replaced with an sap.m.Link control. "description" and "textDirection" setters can be used for this aggregation.

getCustomText

Gets content of aggregation customText.

The (optional) custom Text control of this page. Use this aggregation when the "text" (sap.m.Text) control needs to be replaced with an sap.m.Link control. "text" and "textDirection" setters can be used for this aggregation.

getDescription

Gets current value of property description.

Determines the detailed description that shows additional information on the MessagePage.

Default value is "Check the filter settings.".

getEnableFormattedText

Gets current value of property enableFormattedText.

Defines whether the value set in the description property is displayed as formatted text in HTML format.

For details regarding supported HTML tags, see sap.m.FormattedText

Default value is false.

getIcon

Gets current value of property icon.

Determines the icon displayed on the MessagePage.

Default value is "sap-icon://documents".

getIconAlt

Gets current value of property iconAlt.

Defines the alt attribute of the icon displayed on the MessagePage.

sap.m.MessagePage.getMetadata

Returns a metadata object for class sap.m.MessagePage.

getShowHeader

Gets current value of property showHeader.

Determines the visibility of the MessagePage header. Can be used to hide the header of the MessagePage when it's embedded in another page.

Default value is true.

getShowNavButton

Gets current value of property showNavButton.

Determines the visibility of the navigation button in MessagePage header.

Default value is false.

getText

Gets current value of property text.

Determines the main text displayed on the MessagePage.

Default value is "No matching items found.".

getTextDirection

Gets current value of property textDirection.

Determines the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

Default value is Inherit.

getTitle

Gets current value of property title.

Determines the title in the header of MessagePage.

indexOfButton

Checks for the provided sap.m.Button in the aggregation buttons. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oButton sap.m.Button

The button whose index is looked for

insertButton

Inserts a button into the aggregation buttons.

Param Type DefaultValue Description
oButton sap.m.Button

The button to insert; if empty, nothing is inserted

iIndex int

The 0-based index the button should be inserted at; for a negative value of iIndex, the button is inserted at position 0; for a value greater than the current size of the aggregation, the button is inserted at the last position

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAllButtons

Removes all the controls from the aggregation buttons.

Additionally, it unregisters them from the hosting UIArea.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

Param Type DefaultValue Description
vAriaDescribedBy int sap.ui.core.ID sap.ui.core.Control

The ariaDescribedBy to be removed or its index or ID

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

removeButton

Removes a button from the aggregation buttons.

Param Type DefaultValue Description
vButton int string sap.m.Button

The button to remove or its index or id

setCustomDescription

Sets the aggregated customDescription.

Param Type DefaultValue Description
oCustomDescription sap.m.Link

The customDescription to set

setCustomText

Sets the aggregated customText.

Param Type DefaultValue Description
oCustomText sap.m.Link

The customText to set

setDescription

Sets a new value for property description.

Determines the detailed description that shows additional information on the MessagePage.

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

Default value is "Check the filter settings.".

Param Type DefaultValue Description
sDescription string "Check the filter settings."

New value for property description

setEnableFormattedText

Sets a new value for property enableFormattedText.

Defines whether the value set in the description property is displayed as formatted text in HTML format.

For details regarding supported HTML tags, see sap.m.FormattedText

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

Default value is false.

Param Type DefaultValue Description
bEnableFormattedText boolean false

New value for property enableFormattedText

setIcon

Sets a new value for property icon.

Determines the icon displayed on the MessagePage.

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

Default value is "sap-icon://documents".

Param Type DefaultValue Description
sIcon sap.ui.core.URI "sap-icon://documents"

New value for property icon

setIconAlt

Sets a new value for property iconAlt.

Defines the alt attribute of the icon displayed on the MessagePage.

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

Param Type DefaultValue Description
sIconAlt string

New value for property iconAlt

setShowHeader

Sets a new value for property showHeader.

Determines the visibility of the MessagePage header. Can be used to hide the header of the MessagePage when it's embedded in another page.

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

Default value is true.

Param Type DefaultValue Description
bShowHeader boolean true

New value for property showHeader

setShowNavButton

Sets a new value for property showNavButton.

Determines the visibility of the navigation button in MessagePage header.

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

Default value is false.

Param Type DefaultValue Description
bShowNavButton boolean false

New value for property showNavButton

setText

Sets a new value for property text.

Determines the main text displayed on the MessagePage.

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

Default value is "No matching items found.".

Param Type DefaultValue Description
sText string "No matching items found."

New value for property text

setTextDirection

Sets a new value for property textDirection.

Determines the element's text directionality with enumerated options. By default, the control inherits text direction from the DOM.

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

Default value is Inherit.

Param Type DefaultValue Description
sTextDirection sap.ui.core.TextDirection Inherit

New value for property textDirection

setTitle

Sets a new value for property title.

Determines the title in the header of MessagePage.

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

Param Type DefaultValue Description
sTitle string

New value for property title