cancel
Showing results for 
Search instead for 
Did you mean: 

How to get error message from odata while using smart table and smart filter .

former_member275924
Active Participant
0 Kudos

Hi ,

I want to show error message that return from odata . I use smart table and filter . so I can't catch the error message from odata .

How can I get error message and show in screen ?

I write the logic in search event of smart filter bar and beforeRebindTable event of smart Table but there is no return data . After the event the error shown as image . How should I do?

Best Regards,

Phyo

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor

model has a method attachRequestFailed

check if it can help.

Answers (1)

Answers (1)

prashil
Advisor
Advisor

Hi PhyoPa,

I recommend to use message model and Error handler to show up the messages.

https://sapui5.hana.ondemand.com/#/topic/81c735e69d354de98b0bd139e4bd4e10

Error handler is something you have to write on your own, to catch the exception.

You need to use. as Jun Wu suggested, attachRequestFailed event to catch the error for model.

oModel.attachRequestFailed(this._showErrorMessage);

Inside the _showErrorMessage, you can then decide whether to show it as dialog or leave it.

Thanks

Prashil