<!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.XML,
});
oView.placeAt("content");
});
</script>
</head>
<body class="sapUiBody" id="content">
</body>
</html>
<mvc:View
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
controllerName="saphanatutorial.controller.HelloWorld" >
<Button
text="Say Hello"
press="onPress"/>
</mvc:View>
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast"
], function(Controller, MessageToast) {
"use strict";
return Controller.extend("saphanatutorial.controller.HelloWorld", {
onPress: function(Event) {
MessageToast.show("Hello! This is a Message Toast");
}
});
});