Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Effective update on UI5 via websocket/OData

Hi,

First of all I'm a beginner from every aspect in the web development.

However I created a small application (some kind of online monitoring) which displays backend data and refreshed automtically as soon as something relevant is changed on the backend.

Shortly: UI table binded to OData model and I do a model refresh when a message arrives via websocket.

This works, but not the best from performance perspective.

I mean it would be better if only the changed entry would be refreshed or only the relevant entry would be added/deleted on the UI correspondingly to the backend change. 

Is there any recommendation how it should be implemented?

How should be the change communicated via websocket?

How can I refresh only a part of the model/ui table?

Thanks for your help in advance.

Regards,

Gyula

replied

Hi Gyula,

  1. Should I "store" the last token on client(UI5) side or I should somehow read the last token on backend side (if it is possible at all) and pass this via the websocket?
  2. Beginner question: what is the best practise to update the OData link with the new token and force the rereading? Can I simply call the refresh of the modell after the link is changed?

I'm not really sure, I don't have experience with web sockets yet... If I understand correctly when rereading your opening post, you receive a notification the moment you want to update the data. Then it depends how you have implemented your view and what you really want to achieve.

Some technical info regarding URL parameters: (Demokit v2.ODataModel)

When you create the ODataModel, you can pass a map of custom URL parameters to the constructor. It is then appended to every call of the ODataModel. Also when calling the read method of the model you can pass additional url parameters. But as I said, it depends on your implementation.

Did you already create a test application for this? Maybe you can share some code of what you already have. In that way it is easier to give a clear answer.

Best regards,

Maarten

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question