cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: XML views

former_member226234
Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

pierre_dominique2
Contributor

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

Answers (0)