Skip to Content

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

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

errormsg.png (128.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 16, 2020 at 03:47 PM

    model has a method attachRequestFailed

    check if it can help.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 17, 2020 at 04:47 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.