<!DOCTYPE html>
<html style="height: 100%;">
<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://openui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-async="true"
data-sap-ui-compatversion="edge"
data-sap-ui-excludejquerycompat="true"
data-sap-ui-oninit="module:sap/ui/core/ComponentSupport"
data-sap-ui-resourceroots='{ "demo": "./" }'
data-sap-ui-xx-componentpreload="off"
data-sap-ui-xx-waitfortheme="init"
></script>
</head>
<body id="content" class="sapUiBody">
<div style="height: 100%;"
data-sap-ui-component
data-id="rootComponentContainer"
data-name="demo"
data-height="100%"
data-settings='{ "id": "rootComponent" }'
></div>
</body>
</html>
{
"_version": "1.12.0",
"start_url": "index.html",
"sap.app": {
"id": "demo",
"type": "application",
"title": "foo",
"applicationVersion": {
"version": "1.0.0"
},
"dataSources": {
"odataDemo": {
"uri": "https://cors-anywhere.herokuapp.com/https://services.odata.org/V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
},
"sap.ui": {
"technology": "UI5",
"deviceTypes": {
"desktop": true,
"tablet": true,
"phone": true
}
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.77.2",
"libs": {
"sap.ui.core": {},
"sap.m": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"odataModel": {
"dataSource": "odataDemo",
"settings": {
"tokenHandling": false,
"preliminaryContext": true,
"canonicalRequests": true
},
"preload": true
}
},
"rootView": {
"viewName": "demo.view.App",
"type": "XML",
"id": "rootView",
"async": true
},
"routing": {
"routes": [
{
"pattern": "",
"name": "home",
"target": "home"
}
],
"targets": {
"home": {
"viewId": "homeView",
"viewName": "Home",
"viewLevel": 1
},
"notFound": {
"viewName": "Home",
"transition": "show"
}
},
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"async": true,
"viewPath": "demo.view",
"transition": "slide",
"controlId": "myApp",
"controlAggregation": "pages",
"bypassed": {
"target": "notFound"
}
}
}
}
}
<mvc:View
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
displayBlock="true"
height="100%"
>
<Shell>
<App id="myApp" autoFocus="false">
<!-- Child views are added here by the router -->
</App>
</Shell>
</mvc:View>
<mvc:View xmlns:mvc="sap.ui.core.mvc"
xmlns:core="sap.ui.core"
core:require="{ EdmStringType: 'sap/ui/model/odata/type/String' }">
<Page xmlns="sap.m"
title="Products from UK AND Product Name Not Starting with "Sir""
backgroundDesign="List"
>
<List items="{
path: 'odataModel>/Products',
templateShareable: false,
parameters: {
expand: 'Category, Supplier',
select: 'ProductID, ProductName, UnitsInStock, Category/CategoryID, Category/CategoryName, Supplier/SupplierID, Supplier/Country'
},
sorter: [
{
path: 'Category/CategoryName',
group: true
},
{
path: 'ProductName'
}
],
filters: [
{
filters: [
{
path: 'Supplier/Country',
operator: 'EQ',
value1: 'UK',
caseSensitive: false
}, {
path: 'ProductName',
operator: 'NotStartsWith',
value1: 'Sir ',
caseSensitive: false
}
],
and: true
}
]
}" busyIndicatorDelay="0" growing="true">
<ObjectListItem
title="{ path: 'odataModel>ProductName', type: 'EdmStringType' }"
number="{ path: 'odataModel>UnitsInStock', type: 'EdmStringType' }" />
</List>
</Page>
</mvc:View>
sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
], function(UIComponent, Device) {
"use strict";
return UIComponent.extend("demo.Component", {
metadata: {
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;
},
});
});