cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5, Creating own instances of MessageManager deprecated from 1.115

florin1335
Explorer
0 Kudos

Hi,

I've noticed that starting from SAPUI5 1.115 the sap.ui.core.message.MessageManager is becoming a singleton and creating own instances of it is deprecated. We've used multiple instances of the MessageManager in our project for mainly one reason, to have different instances of the MessageModel to be able to have a bit of separation of concerns.

For instance, since the sap.ui.getCore().getMessageManager() will contain error messages for failed oData requests and we are often clearing all messages before doing a $batch request for error handling, we used a new instance of the MessageManager to handle field validation on a creation screen, which will always contain messages only related to that without having the risk or need of clearing them. Another example where two message models would be handy is to do field validations inside a dialog on a creation screen, so the error message count in the footer of the page doesn't increase due to messages inside the dialog and also since there is a model that contains only messages related to the dialog, you don't have to check each control individually.

Could you help me with an advice on this topic? Is this just a bad pattern/thing to do and what could we do instead?

Accepted Solutions (0)

Answers (0)