I am trying to build one application where i am trying to fetch data through ODATA service and trying to populate the table in SAP UI5. Below is the code
<script>
var oTable = new sap.ui.table.Table({
title: "Outstanding Balance",
visibleRowCount: 5,
//firstVisibleRow: 5,
selectionMode:
sap.ui.table.SelectionMode.Single
});
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "CustomerID"}),
template: new sap.ui.commons.TextField().bindProperty("value", "Customer"),
// sortProperty: "Customer",
//filterProperty: "Customer",
width: "200px"
}));
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Name"}),
template: new sap.ui.commons.TextField().bindProperty("value", "Name"),
//sortProperty: "Name",
//filterProperty: "Name",
width: "100px"
}));
var oModel = new sap.ui.model.odata.ODataModel(
"/sap/opu/odata/sap/Z_ATC_CUSTOMER_OUTSTANDING_SRV",true,"ABCD","1234");
oTable.setModel(oModel);
// bind path of oDataModel to table rows
oTable.bindRows("/CUSTOMERSet");
oTable.placeAt("content");
//}
// })
Kindly help me where i am wrong. My code is running fine in the server but no data is getting populated in the table.
