Hi
i created my SAPUI5 project. the first file is xsodataTest.xml which contain the current code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons,sap.ui.table"
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
<script>
sap.ui.localResources("exercises_ui");
var view = sap.ui.view({id:"idxsodataTest", viewName:"exercises_ui.xsodataTest", type:sap.ui.core.mvc.ViewType.JS});
view.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content" style="direction:ltr">dfgdfg</div>
</body>
</html>
The second file as xsodataTest.view.js which contain the current code:
sap.ui.jsview("exercises_ui.xsodataTest", {
/** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf exercises_ui.xsodataTest
*/
getControllerName : function() {
return "exercises_ui.xsodataTest";
},
/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf exercises_ui.xsodataTest
*/
createContent : function(oController) {
var oLayout = new sap.ui.commons.layout.MatrixLayout({width:"100%"});
var oModel = new sap.ui.model.odata.ODataModel("192.168.10.119:8000/workshop/sessiona/00/MO_SalesData.xsodata", false);
var oControl;
this.oSHTable = new sap.ui.table.Table("soTable",{ visibleRowCount: 10, });
this.oSHTable.setTitle("SALES_ORDER_HEADERS");
//Table Column Definitions
oControl = new sap.ui.commons.TextView().bindProperty("text","Country");
this.oSHTable.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: "Country"}), template: oControl, sortProperty: "Country", filterProperty: "Country", filterOperator: sap.ui.model.FilterOperator.EQ, flexible: true }));
oControl = new sap.ui.commons.TextView().bindProperty("text","CardCode");
this.oSHTable.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: "CardCode"}), template: oControl, sortProperty: "CardCode", filterProperty: "CardCode" }));
oControl = new sap.ui.commons.TextView().bindProperty("text","CardName");
this.oSHTable.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: "CardName"}), template: oControl, sortProperty: "CardName", filterProperty: "CardName", filterOperator: sap.ui.model.FilterOperator.Contains }));
oControl = new sap.ui.commons.TextView().bindText("DocNum",oController.numericFormatter);
oControl.setTextAlign("End");
this.oSHTable.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: "DocNum"}), template: oControl, sortProperty: "DocNum", filterProperty: "DocNum", hAlign: sap.ui.commons.layout.HAlign.End}));
oControl = new sap.ui.commons.TextView().bindProperty("text","Quantity");
this.oSHTable.addColumn(new sap.ui.table.Column({label:new sap.ui.commons.Label({text: "Quantity"}), template: oControl, sortProperty: "Quantity", filterProperty: "Quantity" }));
this.oSHTable.setModel(oModel);
var sort1 = new sap.ui.model.Sorter("Country", true);
this.oSHTable.bindRows({ path: "/SalesOrderHeader", parameters: {expand: "Country", select: "Country,CardCode,CardName,DocNum,Quantity"}, sorter: sort1 });
this.oSHTable.setTitle("Sales Orders");
oLayout.createRow(this.oSHTable);
return oLayout;
}
});
when i'm uploading MO_SalesData.xsodata in the browser it's present it content properly as can be seen in the attached picture.
but when i'm uploading xsodataTest.html webpage i can't see the MO_SalesData data and i have connection problem as can be seen in the attached printscreen too.
Please advice regarding my problem