Skip to Content

OData model binding - update data manually

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 21, 2015 at 03:16 PM

    there is an app parameter for that

    refreshAfterChange


    SAPUI5 SDK - Demo Kit

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 21, 2015 at 03:33 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 26, 2015 at 02:27 PM

    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

    Add comment
    10|10000 characters needed characters exceeded