Issue
I am trying to make a hello world web full-screen application. So, I created a new project called Hello world. Then, I created a folder called WebContent. Inside it, I put the following code in an index.html as following.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-resourceroots='{"com.Project":""}'>
</script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
<script>
var app = new sap.m.App({initialPage:"idpage1"});
var page1 = sap.ui.view({id:"idpage1", viewName:"com.Project.HelloWorld.Page1", type:sap.ui.core.mvc.ViewType.XML});
app.addPage(Page1);
app.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
Then, in this directory WebContent/ HelloWorld
I put a file called Page1.controller.js with the following code in it
WebContent/ HelloWorld/ Page1.controller.js
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("com.Project.HellowWorld.Page1", {
});
});
Also, I made another file as following
WebContent/ HelloWorld/ Page1.view.xml
<!DOCTYPE xml>
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
controllerName="com.Project.HellowWorld.Page1" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Full screen App">
<content>
</content>
</Page>
</core:View>
The problem is that the background appears. But, the whole content does not appear on the page as required.
I am following a course published by an external consultant by the way.
Solution
I just found the solution to my problem.
In the index.html:20
this part of my code is written like this app.addPage(Page1);
So, I just replaced it with app.addPage(page1);
and the error disappeared.
Answered By - Abdulaziz Al Jumaia
Answer Checked By - Mildred Charles (JavaFixing Admin)