Displays an empty page with an icon and a header when certain conditions are met.
MessagePage is displayed when there is no data or matching content. There are different use cases where a MessagePage might be visualized, for example:
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 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 |
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 For details regarding supported HTML tags, see sap.m.FormattedText |
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 |
|
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 |
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. |
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. |
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). |
Event | Description |
---|---|
navButtonPress |
This event is fired when Nav Button is pressed. |
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 When called, the context of the event handler (its 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 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
|
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 |
getEnableFormattedText |
Gets current value of property enableFormattedText. Defines whether the value set in the For details regarding supported HTML tags, see sap.m.FormattedText Default value is |
getIcon |
Gets current value of property icon. Determines the icon displayed on the MessagePage. Default value is |
getIconAlt |
Gets current value of property iconAlt. Defines the alt attribute of the icon displayed on the |
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 |
getShowNavButton |
Gets current value of property showNavButton. Determines the visibility of the navigation button in MessagePage header. Default value is |
getText |
Gets current value of property text. Determines the main text displayed on the MessagePage. Default value is |
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 |
getTitle |
Gets current value of property title. Determines the title in the header of MessagePage. |
indexOfButton |
Checks for the provided |
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 Default value is |
setEnableFormattedText |
Sets a new value for property enableFormattedText. Defines whether the value set in the For details regarding supported HTML tags, see sap.m.FormattedText When called with a value of Default value is |
setIcon |
Sets a new value for property icon. Determines the icon displayed on the MessagePage. When called with a value of Default value is |
setIconAlt |
Sets a new value for property iconAlt. Defines the alt attribute of the icon displayed on the When called with a value of |
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 Default value is |
setShowNavButton |
Sets a new value for property showNavButton. Determines the visibility of the navigation button in MessagePage header. When called with a value of Default value is |
setText |
Sets a new value for property text. Determines the main text displayed on the MessagePage. When called with a value of Default value is |
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 Default value is |
setTitle |
Sets a new value for property title. Determines the title in the header of MessagePage. When called with a value of |
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 |
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 |
Adds some button to the aggregation buttons.
Param | Type | DefaultValue | Description |
---|---|---|---|
oButton | sap.m.Button |
The button to add; if empty, nothing is inserted |
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 |
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
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.
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.
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.
Gets current value of property description.
Determines the detailed description that shows additional information on the MessagePage.
Default value is "Check the filter settings."
.
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
.
Gets current value of property icon.
Determines the icon displayed on the MessagePage.
Default value is "sap-icon://documents"
.
Gets current value of property iconAlt.
Defines the alt attribute of the icon displayed on the MessagePage
.
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
.
Gets current value of property text.
Determines the main text displayed on the MessagePage.
Default value is "No matching items found."
.
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
.
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 |
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 |
Removes all the controls from the aggregation buttons.
Additionally, it unregisters them from the hosting UIArea.
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 |
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 |
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 |
Sets the aggregated customDescription.
Param | Type | DefaultValue | Description |
---|---|---|---|
oCustomDescription | sap.m.Link |
The customDescription to set |
Sets the aggregated customText.
Param | Type | DefaultValue | Description |
---|---|---|---|
oCustomText | sap.m.Link |
The customText to set |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |