<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Demo</title>
<script id="sap-ui-bootstrap"
src="https://sdk.openui5.org/resources/sap-ui-core.js"
data-sap-ui-theme="sap_horizon"
data-sap-ui-async="true"
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-compatversion="edge"
data-sap-ui-resourceroots='{"demo": "./"}'
data-sap-ui-excludejquerycompat="true"
data-sap-ui-xx-waitfortheme="init"
></script>
</head>
<body id="content" class="sapUiBody">
<div data-sap-ui-component
data-id="rootComponentContainer"
data-settings='{"id": "rootComponent"}'
data-name="demo"
data-height="100%"
class="myRootComponentContainer"
></div>
</body>
</html>
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
"sap/ui/core/ComponentSupport",//https://github.com/SAP/ui5-tooling/issues/381
], function(UIComponent, Device) {
"use strict";
return UIComponent.extend("demo.Component", {
metadata: {
interfaces: [
"sap.ui.core.IAsyncContentCreation",
],
manifest: "json",
},
init: function () {
UIComponent.prototype.init.apply(this, arguments);
this.setDensity().getRouter().initialize();
},
setDensity: function ({
styleClass = Device.system.desktop ? "sapUiSizeCompact" : "sapUiSizeCozy",
targetElement = document.body,
} = {}) {
targetElement.classList.add(styleClass);
return this;
},
});
});
{
"_version": "1.46.0",
"start_url": "index.html",
"sap.app": {
"id": "demo",
"type": "application",
"title": "foo",
"description": "bar",
"applicationVersion": {
"version": "1.0.0"
}
},
"sap.ui": {
"technology": "UI5",
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.98.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.f": {},
"sap.ui.layout": {},
"sap.ui.unified": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {},
"resources": {
"css": [
{
"uri": "ui5://demo/css/style.css"
}
]
},
"rootView": {
"viewName": "demo.view.Root",
"id": "rootView",
"type": "XML",
"async": true
},
"routing": {
"routes": [
{
"name": "home",
"pattern": "",
"target": [
"home"
],
"layout": "OneColumn"
}
],
"targets": {
"home": {
"id": "homeView",
"name": "Home",
"controlAggregation": "beginColumnPages",
"level": 1
},
"notFound": {
"name": "Home",
"controlAggregation": "beginColumnPages",
"transition": "fade",
"level": 98
}
},
"config": {
"async": true,
"routerClass": "sap.f.routing.Router",
"type": "View",
"viewType": "XML",
"path": "demo.view",
"controlId": "fcl",
"transition": "slide",
"bypassed": {
"target": "notFound"
},
"homeRoute": "home"
}
}
}
}
<mvc:View controllerName="demo.controller.Root"
xmlns:mvc="sap.ui.core.mvc"
xmlns:f="sap.f"
xmlns="sap.m"
height="100%"
displayBlock="true"
>
<f:FlexibleColumnLayout id="fcl">
<f:beginColumnPages>
<!-- Added by router -->
</f:beginColumnPages>
<f:midColumnPages>
<!-- Added by router -->
</f:midColumnPages>
<f:endColumnPages>
<!-- Added by router -->
</f:endColumnPages>
</f:FlexibleColumnLayout>
</mvc:View>
<mvc:View controllerName="demo.controller.Home"
xmlns:mvc="sap.ui.core.mvc"
xmlns:f="sap.f"
xmlns="sap.m"
height="100%"
>
<f:DynamicPage>
<f:title>
<f:DynamicPageTitle>
<f:heading>
<Title text="Title" />
</f:heading>
</f:DynamicPageTitle>
</f:title>
<f:content>
<Text text="Content.. 🌵" />
</f:content>
</f:DynamicPage>
</mvc:View>
sap.ui.define([
"sap/ui/core/mvc/Controller",
], function(Controller) {
"use strict";
return Controller.extend("demo.controller.Root", {
onInit: function() {
// ...
},
});
});
sap.ui.define([
"sap/ui/core/mvc/Controller",
], function(Controller) {
"use strict";
return Controller.extend("demo.controller.Home", {
onInit: function() {
// ...
},
});
});
html, body, .myRootComponentContainer {
height: 100%;
}