cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.


   this.getView().getModel().getProperty("/Items(BookingId='123',ItemId='Fridge')")

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



Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

FYI: the resolution for this was to create a JSON Model, copy all the data over, and bind the UI to the JSON Model. Then when the changes are complete create batch changes on the OData model.

Answers (2)

Answers (2)

Louis-Arnaud
Participant
0 Kudos

Hello Lindsay,

Could you tell me where did you get this "plus-minus input" ?

former_member182372
Active Contributor
0 Kudos

must probably custom list item

SAPUI5 SDK - Demo Kit

Former Member
0 Kudos

Maksim was correct: it was a custom list item, with two buttons... not very sexy, but there is (as far as I'm aware) no equivalent control at the moment...

0 Kudos

Hi

I also want to use update (PUT) on a entity set. (Do not want to use $Batch).

Did you get the solution for this?

former_member182372
Active Contributor
0 Kudos