on 2015 Aug 07 10:41 AM
Hi,
I have created a SAPUI5 application project with "javascript" as view type.
I want a tutorial how to use controls in SAPUI5. I have used this link SAPUI5 SDK - Demo Kit
but at nothing is displayed in "sample1".
here is my code
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{"view": "./"}'
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
<script>
sap.ui.localResources("view");
var app = new sap.m.App({initialPage:"idHelloWorld"});
var page = sap.ui.view({id:"idHelloWorld", viewName:"view.HelloWorld", type:sap.ui.core.mvc.ViewType.JS});
app.addPage(page);
app.placeAt("content");
// create a simple button with some text and a tooltip only
var oButton1 = new sap.ui.commons.Button({
text : "Button",
tooltip : "This is a test tooltip",
press : function() {alert('Alert from ' + oButton1.getText());}
});
// attach it to some element in the page
oButton1.placeAt("sample1");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content">
</div>
<div id="sample1"></div>
</body>
</html>
Request clarification before answering.
add "sap.ui.commons" in boot strap lib,
data-sap-ui-libs="sap.m,sap.ui.commons"
Why 2 <div> in index.html.
go through this links,
https://openui5beta.hana.ondemand.com/explored.html#/entity/sap.m.tutorial.walkthrough/samples
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks,
libs was the problem, I added sap.ui.commons and it works.
I will look and follow above samples provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.