on 04-14-2014 6:24 AM
Hi Experts,
I am stuck trying out MVC in SAPUI5.
Please help me figure out the issue with my code.
Code as below :
Index.html
<!DOCTYPE html>
<html><head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<title>test</title>
<script id='sap-ui-bootstrap'
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme='sap_goldreflection'
data-sap-ui-libs='sap.ui.commons,sap.ui.table'></script>
<script id='sap-ui-bootstrap'
src='mvc.js'></script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
<div id='table'></div>
</body>
</html>
Please find the JS in the text file attached. |
Thanks and Regards,
Rajanag
Hi,
For example my project structure is like below.
We can call the controller in the project like below in index.html page.
<script>
sap.ui.localResources("chart_nav_bar"); // Folder name in which our controller is placed
var app = new sap.m.App({initialPage:"idnavbar1"});
var page = sap.ui.view({id:"idnavbar1", viewName:"chart_nav_bar.navbar",
type:sap.ui.core.mvc.ViewType.JS}); // Folder name and file name
app.addPage(page);
app.placeAt("content");
</script>
It will help you.
Thanks&Regards
Sridevi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We have sample application in SAPUI5 demo kit which is following MVC architecture.
Download UI5 demokit by following the path and unzip the file .
In that please follow the below path to get the source code
HTML5Evaluation_complete_1.16.3\sapui5-sdk-static\test-resources\sap\m\demokit\mvc
Thanks&Regards
Sridevi
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
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.