cancel
Showing results for 
Search instead for 
Did you mean: 

What is about Resources and Namespaces in SAPUI5 demo app ?

0 Kudos

Hello my dear SAP colleagues:)

I tried to creat my own app in eclipse according to tutorial: in

Step 1: Index - User Interface Add-On for SAP NetWeaver - SAP Library

there is information about "Resources and Namespaces". I dont understand why there is "sap.ui.demo.tdg" ?

So if i create aplication named myTutorial the Namespace should be like that sap.ui.demo.myTutorial or just myTutorial?

Can somebody explain it to me?

Accepted Solutions (1)

Accepted Solutions (1)

ugurkaya
Active Participant
0 Kudos

Hey,

You can define your namespace and resorceroot as you like in your application. You don't need to start with sap.ui.xxxx or etc.

0 Kudos

So for example can I create name myOwnNamespace and use it like this?:

        <script id="sap-ui-bootstrap"

            src="resources/sap-ui-core.js"

            data-sap-ui-libs="sap.m"

            data-sap-ui-theme="sap_bluecrystal"

            data-sap-ui-xx-bindingSyntax="complex"

            data-sap-ui-resourceroots='{"myOwnNamespace": "./"}'>

        </script>

        <script type="text/javascript" src="cordova.js"></script>

        <link rel="stylesheet" type="text/css" href="css/style.css">

        <script>

        jQuery.sap.require("myOwnNamespace");

instead of this

And it should be working?

ugurkaya
Active Participant
0 Kudos

Yes, also "jQuery.sap.require("myOwnNamespace");" should not be necessary..

You should also remember to change the definition of the views, controllers etc. if you are going to copy paste from an example app.

For example

<mvc:View

  controllerName="myOwnNamespace.controller.Master"

  displayBlock="true"

  xmlns:mvc="sap.ui.core.mvc"

  xmlns="sap.m"

  xmlns:core="sap.ui.core"

  xmlns:html="http://www.w3.org/1999/xhtml">

in this case it means my Master.controler is in a folder named "controller" in the project root.

0 Kudos

thank you very much

Answers (0)