openui5
openui5 copied to clipboard
Support submitMode.API for delete in OData V4
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.
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.
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.
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.