on 02-27-2017 10:23 AM
I am learning app development using SAPUI5. I am using eclipse Luna version. I am learning to develop through SAPUI5 tutorials https://sapui5.hana.ondemand.com/#docs/guide/8b49fc198bf04b2d9800fc37fecbb218.html
I am stuck at Step 4: XML views (Walkthrough). I am unable to find the root folder and the view name to be passed to the index file. Please find the code below.
Index.html
<!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="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_belize"
data-sap-ui-libs="sap.m"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="async"
data-sap-ui-resourcerrots='{"???": "./")'>
</script>
<script>
sap.ui.getCore().attachInit(function () {
// alert("UI5 is ready");
sap.ui.xmlview({
viewName : "???"
}).placeAt("content");
});
</script>
</head>
<body id="content">
</body>
</html>
Main.view.xml
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
controllerName="fasttrack_dashboard.Main" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Title">
<content>
<Text text="Hello World"/>
</content>
</Page>
</core:View>
The index file is saved in the following eclipse folder /workspace/<project name>/webcontent/index.html
The view is saved in the following folder /workspace/<project name>/webcontent/<project folder>/Main.view
What will be the root folder and how to call the viewname in the above code.
Thanks for your help.
Hi,
You should put everything in a webapp folder. So you'll have webapp/index.html and then webapp/view/Main.view.xml. This is the recommended structure for a UI5 app: https://sapui5.hana.ondemand.com/#docs/guide/003f755d46d34dd1bbce9ffe08c8d46a.html
Cheers,
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.