user2213621
user2213621

Reputation: 25

SAPUI5 OData v2: delete row from m.Table

I know already from SAPUI5 API reference that I can delete a row from a bound m.Table based on Odata v2 model using the remove method like:

oModel.remove("/Products(999)", {success: mySuccessHandler, error: myErrorHandler});

According to the SAPUI5 docu, this will create a DELETE request to backend server. How can I prevent from immediately sending the DELETE request to backend server in order to control the confirmation to backend by explicitely pressing a SUBMIT button first (calling there the oModel.submitChanges method)? Is operation mode sap.ui.model.odata.OperationMode.Client useful for deletions or does this mode control changed and inserted records into the OData model only?

Yours Stephan

Upvotes: 0

Views: 2408

Answers (1)

Graham Robbo
Graham Robbo

Reputation: 221

You can just pop a confirmation dialog before calling the oModel.remove method.

sap.m.sample.DialogConfirm

Upvotes: 1

Related Questions