<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta charset="UTF-8">
<title>SAPUI5 HelloWorld</title>
<script
id="sap-ui-bootstrap"
src='https://sapui5.hana.ondemand.com/resources/sap-ui-core.js'
data-sap-ui-theme="sap_belize"
data-sap-ui-libs="sap.m"
data-sap-ui-resourceroots='{
"saphanatutorial": "./"
}'>
</script>
<script>
sap.ui.getCore().attachInit(function () {
var oView = sap.ui.view({
viewName: "saphanatutorial.view.HelloWorld",
type:sap.ui.core.mvc.ViewType.JSON,
});
oView.placeAt("content");
});
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
{
"Type":"sap.ui.core.mvc.JSONView",
"controllerName":"saphanatutorial.controller.HelloWorld",
"content": [{
"Type":"sap.m.Button",
"text":"Say Hello with JSON View",
"press": "onPress"
}]
}
sap.ui.define([
"sap/ui/core/mvc/Controller"
], function(Controller) {
"use strict";
return Controller.extend("saphanatutorial.controller.HelloWorld", {
onPress: function(Event) {
alert("Hello! Button clicked in JSON View");
}
});
});