openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

[1.28] ODataModel#createEntry - dont try to update new entries

Open themasch opened this issue 11 years ago • 2 comments

This issue is related to #426 but not the same.

We are using an ODataModel v2 w/o batch request for several reasons. In some parts of the application we want to use the complete input<->model->server TwoWay binding magic. On other parts, this just makes no sense at all like for creating new entries.

When creating an entry using createEntry you get a context and can specify (beside other options) a "batchGroupId". If you specify nothing the model immediately tries to send a POST request to the service to create the entry. This can be changed by adding a "batchGroupId" to the options and add this Id to the "deferredBatchGroups" on the model. But when you bind this context to, lets say, a form and start to edit this newly created entry, the model tries to send POST requests to the service without an id, so these are indeed create requests.

Most of these will of course fail because the user has not entered all information yet and the entry isnt valid at all.

Again, deciding what changed should be send immediately and which should wait for an submitChanges is very hard/impossible here.

Heres a plunker to test the problem: http://plnkr.co/edit/0hhFM4Aj2bgX2wKG8IXa?p=preview

themasch avatar Jun 19 '15 08:06 themasch

Hi themasch, thanks for reporting. I opened internal incident 1570529817 for this. We will come back to you when there is news on this one.

Best Regards, Martin

machwitt avatar Jun 26 '15 14:06 machwitt

Hi themasch, yes, in none batch mode every change will be submitted directly. We will change the behaviour in a feature release, but not in the 1.28. Until then you have to accept the unecessary requests or switch to batch mode. BR, Jan

loginger avatar Jul 20 '15 10:07 loginger