on 10-29-2015 3:26 PM
Hi,
I tried to use the MessagePopover control together with the MessageManager for displaying error messages but I don´t get it to work.
That´s why I´m wondering if there is a good tutorial which explains the handling at a working example. Using Google I didn´t find anything real useful for my case.
But maybe you have an idea.
That´s my coding where I built the messages:
var oMessageProcessor = new sap.ui.core.message.ControlMessageProcessor();
var oMessageManager = sap.ui.getCore().getMessageManager();
oMessageManager.registerMessageProcessor(oMessageProcessor);
oMessageManager.addMessages(
new sap.ui.core.message.Message({
message: "Enter a System ID",
description: "Enter a System ID",
type: sap.ui.core.MessageType.Error,
target: "txtSystemID/value",
processor: oMessageProcessor
})
);
this.getView().setModel(oMessageManager.getMessageModel(), "message");
The view definition looks like this:
<MessagePopover afterClose="" afterOpen="" beforeClose="" beforeOpen="" id="msgPopover" initiallyExpanded="true" itemSelect=""
items="{message>/}" listSelect="" placement="Vertical" xmlns="sap.m">
<items>
<MessagePopoverItem description="{description}" title="{message}" type="{type}"></MessagePopoverItem>
</items>
<!-- sap.m.MessagePopoverItem -->
</MessagePopover>
When I open the MessagePopover it has one item but it shows no text:
I don´t know why it shows no text. Is my binding wrong? Or is my whole approach not correct?
I found the example SAPUI5 Explored MessagePopover but it doesn´t deal with MessageManager. So is my approach the recommended way or shall I use an own model for storing the messages?
Thanks, Sebastian
Hi,
I found the solution here:
http://help.sap.com/saphelp_nw74/helpdata/en/89/56f0a223284d729900ebad4ca88356/content.htm
In short the following changes have to be done:
<MessagePopover afterClose="" afterOpen="" beforeClose="" beforeOpen="" id="msgPopover" initiallyExpanded="true" itemSelect=""
items="{message>/}" listSelect="" placement="Vertical" xmlns="sap.m">
<items>
<MessagePopoverItem description="{message>description}" title="{message>message}" type="{message>type}"></MessagePopoverItem>
</items>
<!-- sap.m.MessagePopoverItem -->
</MessagePopover>
Best regards,
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.