Skip to Content
Jul 29, 2014 at 07:59 AM

Bind a collection within odata result


Hi all,

is it possible to bind a collection within an odata result e.g. to a combobox, table etc?

I have the following code

var oModel = new sap.ui.model.odata.ODataModel("/odata");

sap.ui.getCore().setModel(oModel);"/odata/DOM_PageInit", function (response) {

var oItemTemplate = new sap.ui.core.ListItem({

text: "{BuildingExtended}",


var oComboBox = new sap.ui.commons.ComboBox();

oComboBox.bindItems(response.BuildingList, oItemTemplate);

sap.ui.getCore().getControl("MyMatrix").createRow(new sap.ui.commons.Label({ text: "TestCombo", width: "100px" }), oComboBox);

}, function () {

alert("Read failed");


which results in the following output




"BuildingID":3,"Global_Application_Userrole_ID":7,"UserRoleName":"Advanced Operator","BuildingExtended":"Extended Building 1"


"BuildingID":47,"Global_Application_Userrole_ID":7,"UserRoleName":"Advanced Operator","BuildingExtended":"Extended Building 2"


"BuildingID":9,"Global_Application_Userrole_ID":7,"UserRoleName":"Advanced Operator","BuildingExtended":"Extended Building 3"




"UserDisplayName":"Lastname, Name"


and want to bind the BuildingList collection to the oComboBox, but I always get the error "Missing template or factory function for aggregation items of Element".

Any help is appreciated.