Skip to Content

sap UI5 " success function" and "attachBatchRequestCompleted" order of execution


I am using a CRUD Template to read and edit the data. The template code uses Batch operation. On the Edit View, I am writing code for search help. I am reading the data using "oData. read" method, called upon clicking the search help icon on the MultiInput field.

My problem is, oModel.attachBatchRequestCompleted function is getting executed before the success function of the method. So my Value Help dialog does not have any data to show. OData version is 2.0.

I tried with and without using oModel.submitChanges();

Here is my code(That is called in the event function triggered upon choosing search help)"/BankKeySet", null, null, function(oData, response) { oRowModel.setData(oData);

oView.setModel(oRowModel, "RowModel");

aKeys = oRowModel.getData().results;


function(error, response) { });

// oModel.submitChanges();

oModel.attachBatchRequestCompleted(function(oData) {

var aKeys1 = oView.getModel("RowModel").getData().results;

var oSet = oTable.setModel(oRowModel);

// oTable.bindRows("/BankKeySet");



Please let me know where I am going wrong.



Add comment
10|10000 characters needed characters exceeded

0 Answers