Skip to Content
Oct 29, 2015 at 03:26 PM

sapui5 tutorial for message handling / MessagePopover?



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();

  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">
  <MessagePopoverItem description="{description}" title="{message}" type="{type}"></MessagePopoverItem>
  <!-- sap.m.MessagePopoverItem -->

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