on 10-21-2015 4:49 PM
Hi
I have created a sample Fiori Master Detail application. When I try to run the app, it's displaying a blank screen with a warning message.
Message: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
Index.html:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8">
<title>${project_name}</title>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{"${namespace}": "./"}'>
</script>
<script>
new sap.m.Shell({
app: new sap.ui.core.ComponentContainer({
height : "100%",
name : "${namespace}"
})
}).placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
Component.js:
jQuery.sap.declare("${namespace}.Component");
sap.ui.core.UIComponent.extend("${namespace}.Component", {
createContent : function() {
// create root view
var oView = sap.ui.view({
id: "idViewRoot",
viewName: "${namespace}.view.Root",
type: "XML",
viewData: { component : this }
});
// set data model on root view
oView.setModel(new sap.ui.model.json.JSONModel("model/mock.json"));
// set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : "i18n/messageBundle.properties"
});
oView.setModel(i18nModel, "i18n");
// done
return oView;
}
});
Now it is working well after replacing the script src as "https://sapui5.hana.ondemand.com/resources/sap-ui-core.js". Dont know what's wrong with "resources/sap-ui-core.js".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarbjeet,
Yeah. It's there in javascript resources.I don't know what's wrong with /resources/sap-ui-core.js.
Instead of that, I am using this src ="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js".
Hi Sarbjeet,
If you some time misplaced the folder structure. It will not identify the /resources/sap-ui-core.js. (Usually it must take it automatically).
For your you need to check the folder structure only. Since the complete path with URL is working fine.
Hi Karthik;
This is a warning message usually present in the console log when we make a request to the resources. Are you running your application in the ABAP system or only in the eclipse.
Please share the root view code also. If possible share a screenshot of any error you are getting in the console.
Please go through this document for building step by step a custom fiori application.
Regards,
Sarbjeet Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I running my code in eclipse and browser.I didn't get any error in the console.
This is my root view code:
<?xml version="1.0" encoding="UTF-8" ?>
<mvc:View
controllerName="${namespace}.view.Root"
displayBlock="true"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<SplitApp id="idRoot">
<masterPages>
<mvc:XMLView viewName="${namespace}.view.Master" id="idViewMaster" />
</masterPages>
<detailPages>
<mvc:XMLView viewName="${namespace}.view.Empty" id="idViewEmpty" />
<mvc:XMLView viewName="${namespace}.view.Detail" id="idViewDetail" />
</detailPages>
</SplitApp>
</mvc:View>
HI karthic;
As you are still in the initial phase of developing this, I will ask you to go through the projects provided at the following link.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60668332-b85d-3110-3fb7-8133d856d3e5
You can share the project structure completely for resolving this issue.
Regards,
Sarbjeet Singh
Hi Sarbjeet,
Still I am getting the same error after running the all sample fiori projects which you have given.
Version: Luna Service Release 2 (4.4.2)
SAP UI5 version : 1.30.8
same error as described above :
GET http://localhost:53789/SixthApp/resources/sap-ui-core.js
index.html:21
Uncaught ReferenceError: sap is not defined(anonymous function) @ index.html:21
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.