Skip to content

Instantly share code, notes, and snippets.

@weiserman
Created October 5, 2014 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weiserman/2ef7bd0a844a34402a7f to your computer and use it in GitHub Desktop.
Save weiserman/2ef7bd0a844a34402a7f to your computer and use it in GitHub Desktop.
Hello World SAP UI5
<!DOCTYPE html>
<html lang="en">
<head>
<title>SAPUI5 Hello World live demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="/temp/ui5/resources/sap-ui-core.js"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.ui.commons">
</script>
<!--
data-sap-ui-themes:
- sap_bluecrystal
- sap_goldreflection
- sap_hcb
-->
<style type="text/css">
/* here you could overwrite some sapui5 styles you don't like */
</style>
<script type="text/javascript">
sap.ui.getCore().loadLibrary("sample.uilib", "/temp/ui5/resources/sample/uilib");
var oExample = new sample.uilib.Example({text : "Hello OpenUI5", tooltip : "My Tooltip"}
var oBtn;
//option 1: setting properties via constructor
oBtn = new sap.ui.commons.Button({
text : "Hello World",
press : function (oEvent) {
alert(this.getText());
}
});
oBtn.placeAt("content");
//option 2: setting properties via setters
oBtn = new sap.ui.commons.Button();
oBtn.setText("show sapui5 version");
oBtn.attachPress(function (oEvent) {
alert("sapui5 version = " + sap.ui.version);
});
oBtn.placeAt("content2");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
<br/>
<div id="content2"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment