Skip to Content

Bind the dynamic populated JS array from controller to its xml view list

Hello everyone,

My model has an entity set that has properties: processNumber(key) and UsecaseId. I want to get the count of processes for each Usecase ID.

My expected output is :

Usecase1 : 20

Usecase2 : 30

and so on... And finally it is to be displayed as pie chart.

This is the initial code I started with. And later I had no clue how to bind the array from my controller to view.

Thanks in advance.

Regards Divya

onInit: function() {
var oModel = this.getOwnerComponent().getModel("NewDE4");
oModel.disableHeadRequestForToken = true;

var processStatusFilter = new sap.ui.model.Filter("ProcessStatus", sap.ui.model.FilterOperator.EQ, "04");"/processSet", {
filters: [processStatusFilter],
method: "GET",
success: function(oData) {

var fld = oData.results;
var value = [];
for (var i = 0; i < oData.results.length; i++) {
var json = {};
json.ProcessGuid = fld[i].ProcessGuid;
json.UseCaseId = fld[i].UseCaseId;

var oViewModel = new sap.ui.model.json.JSONModel(json);

error: function() {
alert("Error reading oData");

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers