avatar image
Former Member

sap UI5 "oData.read success function" and "attachBatchRequestCompleted" order of execution

Hi,

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 oData.read 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)

oModel.read("/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");

// this._oValueHelpDialog.open();

});

Please let me know where I am going wrong.

Thanks,

Anna

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers

Skip to Content