Skip to content

Commit c7f0cb2

Browse files
committed
OpenUI5 Documentation Update 12.01.2024
1 parent a6c2c12 commit c7f0cb2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/Message_Model_8956f0a.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,32 @@ The message model is retrieved from the message manager by calling the `getMessa
2121
You use the message model like any other model to bind an aggregation to a root path \("`/`"\), for example the items in a list, and add filters and sorters. Each item in the collection for "`/`" represents an [`sap.ui.core.message.Message`](https://sdk.openui5.org/api/sap.ui.core.message.Message) object, so that you can bind to all properties specified for such an object. The `MessagePopover` control is used to display the messages to the user:
2222

2323
```
24+
// "Messaging" required from "sap/ui/core/Messaging"
2425
// "Button" required from "sap/m/Button"
2526
// "MessagePopover" required from "sap/m/MessagePopover"
2627
// "MessagePopoverItem" required from "sap/m/MessagePopoverItem"
2728
28-
var oMessagePopoverButton = new Button({
29+
const oMessagePopoverButton = new Button({
2930
text: "Show MessagePopover",
3031
type: "Accept",
3132
press: function() {
3233
oMP.openBy(this);
3334
}
3435
});
3536
36-
var oMP = new MessagePopover({
37+
const oMP = new MessagePopover({
3738
items: {
3839
path:"message>/",
39-
template: new MessagePopoverItem({ description: "{message>description}", type: "{message>type}", title: "{message>message}"})
40+
template: new MessagePopoverItem({
41+
description: "{message>description}",
42+
type: "{message>type}",
43+
title: "{message>message}"
44+
})
4045
}
4146
});
4247
43-
oMP.setModel(sap.ui.getCore().getMessageManager().getMessageModel(),"message");
48+
const oMessageModel = Messaging.getMessageModel();
49+
oMP.setModel(oMessageModel(),"message");
4450
4551
oMessagePopoverButton.placeAt("content");
4652
```

0 commit comments

Comments
 (0)