cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAPUI5 tutorial with sap ui5 controls

Former Member
0 Likes
443

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>

Accepted Solutions (1)

Accepted Solutions (1)

santhu_gowdaz
Active Contributor
0 Likes

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

OpenUI5 SDK - Demo Kit

Answers (1)

Answers (1)

Former Member
0 Likes

Thanks,

libs was the problem, I added sap.ui.commons and it works.


I will look and follow above samples provided.