on 07-01-2015 1:40 PM
Hi All,
I was going through the walkthrough tutorial and creating this in eclipse. I reached till step 8 and it was working fine in eclipse. Now I copied all my folders and files to WebIDE and when I tried to run the index.html file as web application, it shows error that "sap is not defined". PFB the screenshots and code of index file.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="UTF-8">
<title>Walkthrough</title>
<script
id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-bindingSyntax="complex"
data-sap-ui-compatVersion="edge"
data-sa-ui-preload="async"
data-sap-ui-resourceroots='{
"sap.ui.demo.wt": "./"
}'>
</script>
<script>
sap.ui.getCore().attachInit(function () {
sap.ui.xmlview({
viewName : "sap.ui.demo.wt.view.App"
}).placeAt("content");
});
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
Please help me in resolving this.
Regards,
Ekansh
change your bootstrap src.
src="https://sapui5.netweaver.ondemand.com/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.
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js" it will look "sap-ui-core.js"
in that path(it will gives updated API). and "resources/sap-ui-core.js" it will looks the sap.ui.core.js in your local dictionary means in your case webide.some times for some reason It's failed to get that.
so after some time try it. same your src="resources/sap-ui-core.js" will work.
Hi Dhananjay,
I just went through all those links. It raised one more question now . In eclipse we are able to load the resources/sap-ui-core.js file as there is mapping done in web.xml file which routes this request to the ui5 runtime. But how this is done in WebIDE as there is no such explicit routing which would be redirecting this request to load this file.
Regards,
Ekansh
Hi Santhosh,
I agree with your point. But why resouces/sap-ui-core.js is not working in one application(the current one which I am discussing) while it works absolutely fine in the other app at the same time?
If there would have been any network issue, it would have affected both the apps in the same manner.
Regards,
Ekansh
Hi Maksim, Dhananjay & Santhosh,
I got it working when I placed all my files in the root 'Walkthrough' folder including the newly created neo-app.json . So finally my project structure in WebIDE is
.user.project.json & sap-ui-cachebuster-info.json files are auto created by WebIDE when you try to run as Web Application. The 'webapp' folder is empty now.
@: neo-app.json is the file which has routes for requests of resources/sap-ui-core.js to the sapui5 services provided by webide. Am I right? Please clarify.
Regards,
Ekansh
yes, that`s the place where you can describe usage of services, destinations etc.like in one of the project it looks like this
"routes": [
{
"path": "/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": " SAPUI5 Resources"
},
{
"path": "/test-resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/test-resources"
},
"description": " SAPUI5 Test Resources"
},
{
"path": "/services/userapi",
"target": {
"type": "service",
"name": "userapi"
}
},
{
"path": "/sap/opu/odata",
"target": {
"type": "destination",
"name": "xxx_GW",
"entryPath": "/sap/opu/odata"
},
"description": "Target OData system"
},
{
"path": "/sap/bc/xxx/file_upload",
"target": {
"type": "destination",
"name": "xxx_GW",
"entryPath": "/sap/bc/xxx/file_upload"
},
"description": "Attachment upload"
},
{
"path": "/cs1",
"target": {
"type": "destination",
"name": "xxx_CS1",
"entryPath": "/"
},
"description": "Target Content Server system"
}
],
Hi Subhashini,
The code for neo-app.json is:
{
"routes": [
{
"path": "/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": "SAPUI5 Resources"
}
]
}
You need to make sure that the folder structure is as I mentioned in below response. All the files should be in the root folder.
Regards,
Ekansh
Thread is locked due to necromancy. Please read the Rules of Engagement in the Getting Started link at the top right of each page. Create your own Discussion if the solution to an already marked Answered thread does not work for you.
Regards, Mike (Moderator)
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That looks like your path to SAPUI5 (src="resources/sap-ui-core.js") is not correct. Check where you deployed it and modify that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.