cancel
Showing results for 
Search instead for 
Did you mean: 

OData model binding - update data manually

Steven_UM
Contributor
0 Kudos

Hi there,

I am well aware that the OData model is in essence a server model and not a client model (like the JSON model).

I have a particular requirement which made me wonder whether it is doable with an OData model - here is the case:

  • OData query is very expensive in processing time so I want to use it with moderation - it returns some data with eg status fields - this data is shown in a mobile list control
  • Users can go into detail of a particular list item
  • There the data can be changed and is updated at the backend meaning some of the status fields changed - I receive back the updated OData entity so I have the new values at my disposal
  • When returning to my list I want the changes to be updated WITHOUT doing a refresh of the model which would cause a new call to the server

Is this possible without having to convert my OData model into an additional JSON model with the added complexity of having to keep both models into sync etc  ?

Thanks for any suggestions ...

Steven

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

there is an app parameter for that

refreshAfterChange


SAPUI5 SDK - Demo Kit

Steven_UM
Contributor
0 Kudos

Hi Maksim,

Thanks for your quick response 🙂

Are you suggesting that setting this flag to 'false' would prevent the model refresh from happening while the binding data in the control is updated automatically?

Thanks,

Steven

former_member182372
Active Contributor
0 Kudos

>>When returning to my list I want the changes to be updated WITHOUT doing a refresh of the model which would cause a new call to the server

that paramatere prevents "refresh of the model"

Answers (2)

Answers (2)

Steven_UM
Contributor
0 Kudos

A quick update ...

As my overview list is using a different entity then my detail list ( on which the action is executed which updates fields that are shown in the list as well ) I also implemented an update method for the list entity.  This update method is then called as well during the action in the detail UI view.

So what is the result of the above ?

  • With default setttings the list is automatically refreshed by calling a new OData get entity set when I return to the previous view => this is exactly what I am trying to avoid (see my question)
  • When I use the model method 'setRefreshAfterChange' ( as mentioned by Maksim ) then the OData call is indeed not done but my list item data is (as expected) also not updated with the changed entity properties ...

so hence the question still 'stands open' ...

Any other pointers or suggestions ?

Thanks,

Steven

Steven_UM
Contributor
0 Kudos

Just for the sake of clarity I should add that

the OData Update is NOT on the entity shown in the list but via one of its navigations ...  so I am not doing any update operations on the bound entity of the list ...

Thanks,

Steven