/scripts/ahub.form.attachments.js
0

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

Jun 09, 2017 at 02:33 PM

148

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers

Skip to Content