Message
Shows contextual feedback directly in the page.
When to use
- Keep an actionable warning or result next to the affected controls.
Examples
A confirmation message
Loading the example
<k:Message state="success" title="Order saved" text="You can continue picking."/>Resolve a delivery warning
Loading the example
<k:Message id="delivery" state="Warning" closable="true" title="Delivery window missing"
text="Confirm a time before dispatch." close=".onClose">
<k:Button text="Use 14:00" press=".onSet"/>
</k:Message>sap.ui.define(["sap/ui/core/mvc/Controller", "kor/ui/Toast"], (Controller, Toast) => Controller.extend("sample.DeliveryMessage", {
onSet() {
const message = this.byId("delivery");
message.setState("success").setTitle("Delivery time set").setText("14:00");
message.destroyActions();
Toast.show("Delivery time saved");
},
onClose() {
Toast.show("Message dismissed");
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
state | string | info | success, wait, danger, info, none or a UI5 message type |
title | string | Heading | |
text | string | Message text | |
closable | boolean | false | Whether the user can dismiss the message |
Aggregations
| Name | Type | Description |
|---|---|---|
actions | sap.ui.core.Control[] | Actions available from the message |
Events
| Name | Type | Description |
|---|---|---|
close | The message was dismissed |