Class sap.m.MessagePageModule: sap/m/MessagePage

extends Control

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 search query returned no results - The app contains no items - There are too many items - The application is loading The layout is unchanged but the text varies depending on the use case.
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.


Since: 1.28.
Constructor Summary
new sap.m.MessagePage(sId?, mSettings?)Constructor for a new MessagePage.
Event Summary
navButtonPress(oControlEvent)This event is fired when Nav Button is pressed.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.MessagePage.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.MessagePage with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.MessagePage.getMetadata()Returns a metadata object for class sap.m.MessagePage.
addAriaDescribedBy(vAriaDescribedBy)Adds some ariaDescribedBy into the association ariaDescribedBy.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
attachNavButtonPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the navButtonPress event of this sap.m.MessagePage.
destroyCustomDescription()Destroys the customDescription in the aggregation customDescription.
destroyCustomText()Destroys the customText in the aggregation customText.
detachNavButtonPress(fnFunction, oListener)Detaches event handler fnFunction from the navButtonPress event of this sap.m.MessagePage.
fireNavButtonPress(mArguments?)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.
getCustomDescription()Gets content of aggregation customDescription.
getCustomText()Gets content of aggregation customText.
getDescription()Gets current value of property description.
getIcon()Gets current value of property icon.
getShowHeader()Gets current value of property showHeader.
getShowNavButton()Gets current value of property showNavButton.
getText()Gets current value of property text.
getTextDirection()Gets current value of property textDirection.
getTitle()Gets current value of property title.
removeAllAriaDescribedBy()Removes all the controls in the association named ariaDescribedBy.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAriaDescribedBy(vAriaDescribedBy)Removes an ariaDescribedBy from the association named ariaDescribedBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
setCustomDescription(oCustomDescription)Sets the aggregated customDescription.
setCustomText(oCustomText)Sets the aggregated customText.
setDescription(sDescription)Sets a new value for property description.
setIcon(sIcon)Sets a new value for property icon.
setShowHeader(bShowHeader)Sets a new value for property showHeader.
setShowNavButton(bShowNavButton)Sets a new value for property showNavButton.
setText(sText)Sets a new value for property text.
setTextDirection(sTextDirection)Sets a new value for property textDirection.
setTitle(sTitle)Sets a new value for property title.
Constructor Detail
new sap.m.MessagePage(sId?, mSettings?)
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 for a general description of the syntax of the settings object.

The supported settings are:

  • Properties
    • text : string (default: No matching items found.)
    • description : string (default: Check the filter settings.)
    • title : string
    • showHeader : boolean (default: true)
    • showNavButton : boolean (default: false)
    • icon : sap.ui.core.URI (default: sap-icon://documents)
    • textDirection : sap.ui.core.TextDirection (default: Inherit)
  • Aggregations
  • Events
    • navButtonPress : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

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
Event Detail
navButtonPress(oControlEvent)
This event is fired when Nav Button is pressed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Since:
1.28.1
Method Detail
sap.m.MessagePage.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.

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.m.MessagePage.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.MessagePage.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaDescribedBy(vAriaDescribedBy): sap.m.MessagePage
Adds some ariaDescribedBy into the association ariaDescribedBy.
Parameters:
{string|sap.ui.core.Control}vAriaDescribedBy the ariaDescribedBy to add; if empty, nothing is inserted
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
addAriaLabelledBy(vAriaLabelledBy): sap.m.MessagePage
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
attachNavButtonPress(oData?, fnFunction, oListener?): sap.m.MessagePage
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.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.MessagePage itself
Since:
1.28.1
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
destroyCustomDescription(): sap.m.MessagePage
Destroys the customDescription in the aggregation customDescription.
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
destroyCustomText(): sap.m.MessagePage
Destroys the customText in the aggregation customText.
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
detachNavButtonPress(fnFunction, oListener): sap.m.MessagePage
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.

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Since:
1.28.1
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
fireNavButtonPress(mArguments?): sap.m.MessagePage
Fires event navButtonPress to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Since:
1.28.1
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
getAriaDescribedBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns:
{sap.ui.core.Control[]}
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
{sap.ui.core.Control[]}
getCustomDescription(): sap.m.Link
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 a sap.m.Link control. "description" and "textDirection" setters can be used for this aggregation.

Returns:
{sap.m.Link}
getCustomText(): sap.m.Link
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 a sap.m.Link control. "text" and "textDirection" setters can be used for this aggregation.

Returns:
{sap.m.Link}
getDescription(): string
Gets current value of property description.

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

Default value is Check the filter settings..

Returns:
{string} Value of property description
getIcon(): sap.ui.core.URI
Gets current value of property icon.

Determines the icon displayed on the MessagePage.

Default value is sap-icon://documents.

Returns:
{sap.ui.core.URI} Value of property icon
getShowHeader(): boolean
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.

Returns:
{boolean} Value of property showHeader
getShowNavButton(): boolean
Gets current value of property showNavButton.

Determines the visibility of the navigation button in MessagePage header.

Default value is false.

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

Determines the main text displayed on the MessagePage.

Default value is No matching items found..

Returns:
{string} Value of property text
getTextDirection(): sap.ui.core.TextDirection
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.

Returns:
{sap.ui.core.TextDirection} Value of property textDirection
getTitle(): string
Gets current value of property title.

Determines the title in the header of MessagePage.

Returns:
{string} Value of property title
removeAllAriaDescribedBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaDescribedBy.
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAriaDescribedBy(vAriaDescribedBy): sap.ui.core.Control
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaDescribedBy The ariaDescribedByto be removed or its index or ID
Returns:
{sap.ui.core.Control} the removed ariaDescribedBy or null
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaLabelledBy The ariaLabelledByto be removed or its index or ID
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
setCustomDescription(oCustomDescription): sap.m.MessagePage
Sets the aggregated customDescription.
Parameters:
{sap.m.Link}oCustomDescription The customDescription to set
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setCustomText(oCustomText): sap.m.MessagePage
Sets the aggregated customText.
Parameters:
{sap.m.Link}oCustomText The customText to set
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setDescription(sDescription): sap.m.MessagePage
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..

Parameters:
{string}sDescription New value for property description
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setIcon(sIcon): sap.m.MessagePage
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.

Parameters:
{sap.ui.core.URI}sIcon New value for property icon
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setShowHeader(bShowHeader): sap.m.MessagePage
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.

Parameters:
{boolean}bShowHeader New value for property showHeader
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setShowNavButton(bShowNavButton): sap.m.MessagePage
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.

Parameters:
{boolean}bShowNavButton New value for property showNavButton
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setText(sText): sap.m.MessagePage
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..

Parameters:
{string}sText New value for property text
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setTextDirection(sTextDirection): sap.m.MessagePage
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.

Parameters:
{sap.ui.core.TextDirection}sTextDirection New value for property textDirection
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining
setTitle(sTitle): sap.m.MessagePage
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.

Parameters:
{string}sTitle New value for property title
Returns:
{sap.m.MessagePage} Reference to this in order to allow method chaining