Skip to Content
0
Former Member
Feb 16, 2016 at 05:41 PM

sap.ui.commons.ComboBox problems

32 Views

I want to use combobox function in xml.view

this is code

xml.view

<c:ComboBox id = "cbbox" items = "{/HHdata}" width = "200px" > <c:items> <core:Item key = "{key}" text = "{text}" /> </c:items>

</c:ComboBox>

controller.js

onInit: function() {

var mData = {

HHdata : [ { "key" : "0", "text" : "All" }, { "key" : "1", "text" : "Approval Request" }, { "key" : "2", "text" : "Approval in Progress" }, { "key" : "3", "text" : "Approval Completed" }, { "key" : "8", "text" : "Deleted" }, { "key" : "9", "text" : "Rejected" } ]

};

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

oJsonModel2.setData(mData, true);

console.log(oJsonModel2);

this.getView().byId("cbbox").setModel(oJsonModel2);

// sap.ui.getCore().setModel(oJsonModel);

},

error message

expert help this problem

Attachments

roaldlld.png (12.3 kB)