hi All,
I was trying to do one basic ODATA example which i got from the threads.
<!DOCTYPE html>
<html><head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>Table with OData Binding</title>
<script id='sap-ui-bootstrap' type='text/javascript'
src='https://sapui5.hana.ondemand.com/resources/sap-ui-core.js'
data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.table"
data-sap-ui-theme="sap_bluecrystal"></script>
<script>
// the root URL of the OData service - prefixed with a local URL to a proxy which forwards the request,
circumventing cross-domain restrictions
// IMPORTANT: this proxy must be available for the code example to run!
var url = "http://services.odata.org/Northwind/Northwind.svc";
// create an ODataModel from URL
var oModel = new sap.ui.model.odata.ODataModel(url, true);
var oTable = new sap.ui.table.Table("sampleTable");
oModel.read("/Customers",null,null,null,function(){
var metadata = oModel.getServiceMetadata();
var entityCustomerRef = metadata.dataServices.schema[0].entityType[2];
var listOfProperties = entityCustomerRef.property;
for ( var i = 0; i < listOfProperties.length; i++) {
oTable.addColumn(new sap.ui.table.Column().setLabel(
new sap.ui.commons.Label({
text : listOfProperties[i].name,
})).setTemplate(
new sap.ui.commons.TextField().bindProperty("value",
listOfProperties[i].name))) }
oTable.setModel(oModel); // set model to Table
oTable.bindRows("/Customers");
});
oTable.placeAt("content"); // place model onto UI
</script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
</body>
</html>
but when i try to execute the same it is not loading any data and showing the error as :
But i can launch the url with metadata through browser..kindly help???