Skip to Content
0

SAPUI5: How To Hide server message popup in Fiori Application?

May 12, 2017 at 11:56 AM

313

avatar image
Former Member

Hello experts,

I have a problem. In my Fiori Application i use method "Create" of Odata Model version 2. Inside of CREATE_ENTITY method i have a condition, and if it is not true, i want to handle response in error callback on the UI. For this I raise an exception of type /iwbep/cx_mgw_busi_exception. because of it i get this error popup on UI:

Is it possible to hide it somehow? I don't want to see it. I want to parse the message and show it in message toast. I tried to delete all messages in message manager, but it is not working.

Best Regards,

Mikhail

untitled.png (6.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Kamal Trivedi May 12, 2017 at 03:03 PM
0

Usually, Toast is only used for information & Success/Failure Messages from the server are always shown in MessageBox.

& for handling such scenarios I would rather send failure with a message from backend response & show it in a toast.

It seems by throwing an exception is being directly handled by framework.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 12, 2017 at 03:45 PM
2

Hi,

There is be a way to do that in UI5 code. There should be a ErrorHandler.js file in your project's webapp/controller folder.

Within that there are listeners for attachMetadataFailed and attachRequestFailed. The call for error message pop-up that you are getting must be within these methods. Once you are there, you could handle the errors differently and remove the pop-ups.

Hope this helps!

Share
10 |10000 characters needed characters left characters exceeded