Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10449

aggregation binding problem with Northwind Customers

$
0
0

I tried use a table to show CustomerID from http://services.odata.org/V4/Northwind/Northwind.svc/Customer.

 

It always reports "No data was retrieved by service: undefined - (from sap-ui-core-dbg.js:13590)". It is actually printed from function _handleSuccess(oData, oResponse) on line 356 of ODataModel-dbg.js. It is invoked as a callback but the input parameter oData is undefined.

 

I attach my code as below. It works fine against Orders collection from the same OData service, after I just changed the binding path to "/Orders" and property to "{OrderID}".

 

Did anyone encounter this problem before? Any hint? thanks.

 

jQuery.sap.require("sap.ui.thirdparty.datajs");

OData.defaultHttpClient.enableJsonpCallback = true;

var url = "proxy/http/services.odata.org/V3/Northwind/Northwind.svc/"; 

var oModel = new sap.ui.model.odata.ODataModel(url, true); 

sap.ui.getCore().setModel(oModel); 

var oTable = new sap.m.Table("table", { // create Table UI  

headerText : "Northwind OData Sample", 

columns : [ new sap.m.Column({ 

  header : new sap.m.Label({ text : "ID" }) 

})],

items : { 

  path : "/Customers", 

  template : new sap.m.ColumnListItem({ 

    cells : [ new sap.m.Text({ text : "{CustomerID}" })] 

   })

});


Viewing all articles
Browse latest Browse all 10449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>