Hi. We are trying to consume oData using SAPUI5. We use the demo Gateway Sales Order. We are trying to create this application on mobile devices.
Below is our index.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="../../../resources/sap-ui-core.js" id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m" data-sap-ui-theme="sap_mvi">
</script>
<!-- only load the mobile lib "sap.m" and the "sap_mvi" theme -->
<script>
// Tell UI5 where to find application content
sap.ui.localResources("view"); //view is the name of the folder where views are stored
jQuery.sap.registerModulePath('Application', 'Application');
// Launch application
jQuery.sap.require("Application");
var oApp = new Application( {
root : "content"
}); // instantiate your application and mark the HTML element with id "content" as location for the UI
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
This is our Application.js
jQuery.sap.declare("Application");
jQuery.sap.require("sap.ui.app.Application");
//Application is the ID
sap.ui.app.Application.extend("Application", {
init : function() {
// set global models
var oModel = new sap.ui.model.odata.ODataModel("proxy/http/gw.esworkplace.sap.com/sap/opu/odata/sap/SALESORDERS/",false,"GW@ESW","ESW4GW");
sap.ui.getCore().setModel(oModel);
},
main : function() {
// create app view and put to html root element
var root = this.getRoot();
sap.ui.jsview("app", "view.App").placeAt(root); //root is div id content
}
});
Tried loading it on Chrome (disabled SOP) but we get this error.