Hi,
I have defined a message model which is reading the exceptions returned from the server and binded it to a message popover.
Popover is working fine and messages are viewable, but I want to delete a specific message from the message model so that it doesn't get reflected in the popover. I am using "removeMessages" method, but it's not removing the messages?
So, any idea what could be the issue? Thanks in advance for the help.
Here is what i have defined in the error handler (error {}) method of the create function (oModel.Create()) -
//code to remove a specific message from the model
var oMessageProcessor = new sap.ui.core.message.ControlMessageProcessor();
sap.ui.getCore().getMessageManager().removeMessages(
new sap.ui.core.message.Message({
code: "/IWBEP/CM_MGW_RT/022",
description: undefined, id: "id-1470187163810-27",
message: "Exception raised without specific error",
processor: oMessageProcessor, t
arget: "/ety_headerSet",
type: "Error", }) );
//Code which is filling message popover with the message model data
var oMessageTemplate = new MessagePopoverItem({
description: "{message>description}",
type: "{message>type}",
title: "{message>message}"
}),
oMessageModel = sap.ui.getCore().getMessageManager().getMessageModel(),
oMessagePopover = new MessagePopover({
items: {
path: 'message>/',
template: oMessageTemplate
}
});
oMessagePopover.setModel(oMessageModel, "message");
return oMessagePopover;
}
};

Thanks
Amit Srivastava