Quantcast
Channel: SCN : Unanswered Discussions - SAP Fiori
Viewing all articles
Browse latest Browse all 1879

Getting data from different entity sets from back-end at once and binding it to dropdown(Select)

$
0
0

Hello Experts,

 

I have created a custom Fiori app. My requirement is when I press a Add button, a form opens in which the user needs to fill data in the drop-downs. Each drop-down will get the data from different entity sets from ODATA. I used the concept of Batch Requests and grouped several odata requests. I am getting the data from back-end. Now my requirement is to bind that data to the dropdowns(Select). Below is the code I used to get data from back-end.

Can anyone help me with binding data to the UI element?

 


var omodel = this.getView().getModel();
var that = this.getView().getController();
var batchChanges = [];
batchChanges.push(omodel.createBatchOperation(  "/entitySetName?$filter=Value+eq+'xyz'",  "GET"));  batchChanges.push(omodel.createBatchOperation(  "/entitySetName?$filter=Value+eq+'abc'",  "GET"));
omodel.addBatchReadOperations(batchChanges);
omodel.setUseBatch(true);
omodel.submitBatch(function(data){
sap.ui.commons.MessageBox.show(data.__batchResponses[0].__changeResponses.length + " contacts created", sap.ui.commons.MessageBox.Icon  .SUCCESS,  "Batch Save", sap.ui.commons.MessageBox.Action.OK);},
function(err)
{
alert("Error occurred ");
});

 

 

Regards,

Priya.


Viewing all articles
Browse latest Browse all 1879

Latest Images

Trending Articles



Latest Images