It is used to display a summarized list of different types of messages (error, warning, success, and information messages).
It is meant to be embedded into container controls (such as sap.m.Popover, sap.m.ResponsivePopover, sap.m.Dialog). It provides a handy and systematized way to navigate and explore details for every message. If the MessageView
contains only one item, which has either description, markupDescription or longTextUrl, its details page will be displayed initially. It also exposes the sap.m.MessageView#event:activeTitlePress event, which can be used for navigation from a message to its source.
MessageView
, this could lead to outdated messages being shown. To avoid this, you need to call navigateBack
on the MessageView
BEFORE opening its container.markupDescription
has to be set to true
. MessageView
provides navigation to the detailed description. The MessageView
stores all messages in an association of type sap.m.MessageItem, named items
.
A set of properties determines how the items are rendered:
activeTitle
property to true and providing a handler for the activeTitlePress
event. The responsiveness of the MessageView
is determined by the container in which it is embedded. For that reason the control could not be visualized if the container’s sizes are not defined.
Constructor for a new MessageView
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.MessageView(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 |
---|---|---|---|
asyncDescriptionHandler | any | Callback function for resolving a promise after description has been asynchronously loaded inside this function. Visibility: public |
|
asyncURLHandler | any | Callback function for resolving a promise after a link has been asynchronously validated inside this function. Visibility: public |
|
groupItems | boolean | false | Defines whether the MessageItems are grouped or not. Visibility: public |
showDetailsPageHeader | boolean | true | Defines whether the header of details page will be shown. Visibility: public |
Default Aggregation: items
Name | Cardinality | Type | Description |
---|---|---|---|
_navContainer | 0..1 | sap.m.NavContainer |
A navContainer that contains both details and list pages. |
headerButton | 0..1 | sap.m.Button |
Sets a custom header button. |
items (default) | 0..n | sap.m.MessageItem |
A list with message items. If only one item is provided, the initial page will be the details page for the item. |
Event | Description |
---|---|
activeTitlePress |
Event fired when an activeTitle of a MessageItem is pressed. |
afterOpen |
Event fired after the popover is opened. |
itemSelect |
Event fired when description is shown. |
listSelect |
Event fired when one of the lists is shown when (not) filtered by type. |
longtextLoaded |
Event fired when the long text description data from a remote URL is loaded. |
urlValidated |
Event fired when a validation of a URL from long text description is ready. |
Event fired when an activeTitle of a MessageItem is pressed.
Since: 1.58.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
item | sap.m.MessageItem |
Refers to the message item that contains the activeTitle. |
Event fired after the popover is opened.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
openBy | sap.ui.core.Control |
This refers to the control which opens the popover. |
Event fired when description is shown.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
item | sap.m.MessageItem |
Refers to the message item that is being presented. |
messageTypeFilter | sap.ui.core.MessageType |
Refers to the type of messages being shown. See sap.ui.core.MessageType values for types. |
Event fired when one of the lists is shown when (not) filtered by type.
Param | Type | Description |
---|---|---|
oControlEvent | sap.ui.base.Event | |
getSource | sap.ui.base.EventProvider | |
getParameters | object | |
messageTypeFilter | sap.ui.core.MessageType |
This parameter refers to the type of messages being shown. |
Method | Description |
---|---|
_makeAutomaticBinding |
If there's no items binding, attach the MessageView to the sap.ui.getCore().getMessageManager().getMessageModel() |
addItem |
Adds some item to the aggregation items. |
attachActiveTitlePress |
Attaches event handler When called, the context of the event handler (its Event fired when an activeTitle of a MessageItem is pressed. |
attachAfterOpen |
Attaches event handler When called, the context of the event handler (its Event fired after the popover is opened.
Since 1.72 Use the appropriate event from the wrapper control, instead.
|
attachItemSelect |
Attaches event handler When called, the context of the event handler (its Event fired when description is shown. |
attachListSelect |
Attaches event handler When called, the context of the event handler (its Event fired when one of the lists is shown when (not) filtered by type. |
attachLongtextLoaded |
Attaches event handler When called, the context of the event handler (its Event fired when the long text description data from a remote URL is loaded. |
attachUrlValidated |
Attaches event handler When called, the context of the event handler (its Event fired when a validation of a URL from long text description is ready. |
destroyHeaderButton |
Destroys the headerButton in the aggregation headerButton. |
destroyItems |
Destroys all the items in the aggregation items. |
detachActiveTitlePress |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachAfterOpen |
Detaches event handler The passed function and listener object must match the ones used for event registration.
Since 1.72 Use the appropriate event from the wrapper control, instead.
|
detachItemSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachListSelect |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachLongtextLoaded |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachUrlValidated |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.m.MessageView.extend |
Creates a new subclass of class sap.m.MessageView with name
|
fireActiveTitlePress |
Fires event activeTitlePress to attached listeners. |
fireAfterOpen |
Fires event afterOpen to attached listeners.
Since 1.72 Use the appropriate event from the wrapper control, instead.
|
fireItemSelect |
Fires event itemSelect to attached listeners. |
fireListSelect |
Fires event listSelect to attached listeners. |
fireLongtextLoaded |
Fires event longtextLoaded to attached listeners. |
fireUrlValidated |
Fires event urlValidated to attached listeners. |
getAsyncDescriptionHandler |
Gets current value of property asyncDescriptionHandler. Callback function for resolving a promise after description has been asynchronously loaded inside this function. |
getAsyncURLHandler |
Gets current value of property asyncURLHandler. Callback function for resolving a promise after a link has been asynchronously validated inside this function. |
getGroupItems |
Gets current value of property groupItems. Defines whether the MessageItems are grouped or not. Default value is |
getHeaderButton |
Gets content of aggregation headerButton. Sets a custom header button. |
getItems |
Gets content of aggregation items. A list with message items. If only one item is provided, the initial page will be the details page for the item. |
sap.m.MessageView.getMetadata |
Returns a metadata object for class sap.m.MessageView. |
getShowDetailsPageHeader |
Gets current value of property showDetailsPageHeader. Defines whether the header of details page will be shown. Default value is |
indexOfItem |
Checks for the provided |
insertItem |
Inserts a item into the aggregation items. |
navigateBack |
Navigates back to the list page |
removeAllItems |
Removes all the controls from the aggregation items. Additionally, it unregisters them from the hosting UIArea. |
removeItem |
Removes a item from the aggregation items. |
setAsyncDescriptionHandler |
Sets a new value for property asyncDescriptionHandler. Callback function for resolving a promise after description has been asynchronously loaded inside this function. When called with a value of |
setAsyncURLHandler |
Sets a new value for property asyncURLHandler. Callback function for resolving a promise after a link has been asynchronously validated inside this function. When called with a value of |
sap.m.MessageView.setDefaultHandlers |
Setter for default description and URL validation callbacks across all instances of MessageView |
setGroupItems |
Sets a new value for property groupItems. Defines whether the MessageItems are grouped or not. When called with a value of Default value is |
setHeaderButton |
Sets the aggregated headerButton. |
setShowDetailsPageHeader |
Sets a new value for property showDetailsPageHeader. Defines whether the header of details page will be shown. When called with a value of Default value is |
If there's no items binding, attach the MessageView to the sap.ui.getCore().getMessageManager().getMessageModel()
Adds some item to the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.m.MessageItem |
The item to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the activeTitlePress event of this sap.m.MessageView
.
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.MessageView
itself.
Event fired when an activeTitle of a MessageItem 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 |
Attaches event handler fnFunction
to the afterOpen event of this sap.m.MessageView
.
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.MessageView
itself.
Event fired after the popover is opened.
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 |
Attaches event handler fnFunction
to the itemSelect event of this sap.m.MessageView
.
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.MessageView
itself.
Event fired when description is shown.
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 |
Attaches event handler fnFunction
to the listSelect event of this sap.m.MessageView
.
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.MessageView
itself.
Event fired when one of the lists is shown when (not) filtered by type.
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 |
Attaches event handler fnFunction
to the longtextLoaded event of this sap.m.MessageView
.
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.MessageView
itself.
Event fired when the long text description data from a remote URL is loaded.
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 |
Attaches event handler fnFunction
to the urlValidated event of this sap.m.MessageView
.
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.MessageView
itself.
Event fired when a validation of a URL from long text description is ready.
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 |
Detaches event handler fnFunction
from the activeTitlePress event of this sap.m.MessageView
.
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 |
Detaches event handler fnFunction
from the afterOpen event of this sap.m.MessageView
.
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 |
Detaches event handler fnFunction
from the itemSelect event of this sap.m.MessageView
.
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 |
Detaches event handler fnFunction
from the listSelect event of this sap.m.MessageView
.
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 |
Detaches event handler fnFunction
from the longtextLoaded event of this sap.m.MessageView
.
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 |
Detaches event handler fnFunction
from the urlValidated event of this sap.m.MessageView
.
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 |
Creates a new subclass of class sap.m.MessageView 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 |
Fires event activeTitlePress to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
item | sap.m.MessageItem |
Refers to the message item that contains the activeTitle. |
Fires event afterOpen to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
openBy | sap.ui.core.Control |
This refers to the control which opens the popover. |
Fires event itemSelect to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
item | sap.m.MessageItem |
Refers to the message item that is being presented. |
|
messageTypeFilter | sap.ui.core.MessageType |
Refers to the type of messages being shown. See sap.ui.core.MessageType values for types. |
Fires event listSelect to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
messageTypeFilter | sap.ui.core.MessageType |
This parameter refers to the type of messages being shown. |
Fires event longtextLoaded to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Fires event urlValidated to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
Gets current value of property asyncDescriptionHandler.
Callback function for resolving a promise after description has been asynchronously loaded inside this function.
Gets current value of property asyncURLHandler.
Callback function for resolving a promise after a link has been asynchronously validated inside this function.
Gets current value of property groupItems.
Defines whether the MessageItems are grouped or not.
Default value is false
.
Gets content of aggregation items.
A list with message items. If only one item is provided, the initial page will be the details page for the item.
Gets current value of property showDetailsPageHeader.
Defines whether the header of details page will be shown.
Default value is true
.
Checks for the provided sap.m.MessageItem
in the aggregation items. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.m.MessageItem |
The item whose index is looked for |
Inserts a item into the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
oItem | sap.m.MessageItem |
The item to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Removes all the controls from the aggregation items.
Additionally, it unregisters them from the hosting UIArea.
Removes a item from the aggregation items.
Param | Type | DefaultValue | Description |
---|---|---|---|
vItem | int string sap.m.MessageItem |
The item to remove or its index or id |
Sets a new value for property asyncDescriptionHandler.
Callback function for resolving a promise after description has been asynchronously loaded inside this function.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
oAsyncDescriptionHandler | any |
New value for property |
Sets a new value for property asyncURLHandler.
Callback function for resolving a promise after a link has been asynchronously validated inside this function.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
oAsyncURLHandler | any |
New value for property |
Setter for default description and URL validation callbacks across all instances of MessageView
Param | Type | DefaultValue | Description |
---|---|---|---|
mDefaultHandlers | object |
An object setting default callbacks |
|
asyncDescriptionHandler | function |
The description handler |
|
asyncURLHandler | function |
The URL handler |
Sets a new value for property groupItems.
Defines whether the MessageItems are grouped or not.
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 |
---|---|---|---|
bGroupItems | boolean | false |
New value for property |
Sets the aggregated headerButton.
Param | Type | DefaultValue | Description |
---|---|---|---|
oHeaderButton | sap.m.Button |
The headerButton to set |
Sets a new value for property showDetailsPageHeader.
Defines whether the header of details page will be shown.
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 |
---|---|---|---|
bShowDetailsPageHeader | boolean | true |
New value for property |