Skip to Content
Former Member
Apr 27, 2015 at 03:33 PM

SetProperty on OData model - update multiple entities before submitChanges on batch


I have a list in my application:

This data is bound to an OData model.

If I perfrom call I can retrieve the data fod the "fridge" item:I can retieve the OData for item 456.


Therefore I can set the couonter like this:

this.getView().getModel().setProperty("/Items(BookingId='123',ItemId='Fridge')"+"/ItemCount", 6) 

But once I have done this "SetProperty" call I am now unable to set any other properties on any of the other items!

What I want is to be able to change as many items as I like and then on SAVE do a batch OData PUT to update the values in the backend.

If I'm honest what I really want is to be able to do a DEEP INSERT into my OData provider, which contains a Booking, with nested sub-items..

Booking 1:m Items

How can I do this whilst also using the "setProperty" method?

setProperty is great in regards to if I make changes and then hit "CANCEL" I can call "resetChanges" to undo any changes.. but at the moment I can only change ONE of these counters before commiting my changes...

Surely this must be a common requirement, to make many changes in the front-end to multiple entities and then POST/PUT them all at once?

Thank you for any advice 😊


cardiff.png (17.2 kB)