openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Support submitMode.API for delete in OData V4

Open bkrrrr opened this issue 5 years ago • 2 comments

OpenUI5 version: any

Browser/version (+device/version):

Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible): https://sapui5.hana.ondemand.com/#/api/sap.ui.model.odata.v4.Context%23methods/delete

"the resulting group ID must not have sap.ui.model.odata.v4.SubmitMode.API."

Suprisingly, there is no support for delete in batch. We have usecases with multiple modification; which includes adding("create supports API...") and removing child elements. Naturally, all of them should be saved in the same batch request.

Additionally, there should be something similar to @$ui5.context.isTransient to check for delete state.

bkrrrr avatar Jan 14 '20 16:01 bkrrrr

Hi @bkrrrr ,

we have the requirement logged as backlog item FIORITECHP1-10897. Please note: It is currently planned, that the deleted record will disappear from the list immediately as Draft and non-Draft applications should behave as similarly as possible. Would that also be an option for you or is it really required that the deleted row stays visible with a deletion indicator?

Best regards Mathias.

uhlmannm avatar Jan 15 '20 15:01 uhlmannm

In our case, it was decided to avoide dialogs if possible. Therefore, UX-Team created a proposel to mark a deleted rows and decorade them with an undo button. This removes the reqirement to have "Do you really want to delete this Item - Dialogs" and provides the user a greate overview of the changes, before he is pressing save(submitBatch).

This was easy to achive for create over the @$ui5.context.isTransient property. Therefore we thought it works in the same way for delete. If this is not planed, we just change our UI and go for dialogs.

in 2020-01-13 11_52_33

bkrrrr avatar Jan 16 '20 08:01 bkrrrr

Since SAPUI5/OpenUI5 1.108, v4.Context#delete can be called with an API group. As outlined above, the deleted record is removed from the list immediately. If that is not wanted, you could try to use an instance annotation like @$my.app.deleted to indicate on the client that a record is deleted and to perform the actual deletion only when the user has hit the "Save" button.

uhlmannm avatar Jan 30 '24 10:01 uhlmannm