Skip to Content
0
Aug 17, 2015 at 04:50 AM

Binding OData Model Entity Set to sap.m.table in Controller

2077 Views

Hi,

I have a sap.m.table defined in XML View. I need to bind this table to oModel Entity Set at runtime , say after the click of Submit button.

I am using the following code to bind the table to entitiy model.

var oModel = this.getView().getModel();

var oTable = this.getView().byId("idPaymentTable");

oTable.setModel(oModel);

oTable.bindAggregation("items", "{/CompanyCodeSet}");

But I am getting the following error in console:

Uncaught Error: Missing template or factory function for aggregation items of Element sap.m.Table#idView1--idPaymentTable !

I am able to bind the entity set to table using "items" in XML View and it works fine. But the binding does not work if I want ot bind the items at runtime.

Can anyone guide me on how to bind oModel Entity Set to table in the controller ?

Regards,

Adren