SapHanaTutorial.Com HOME     Learning-Materials Interview-Q&A Certifications Quiz Online-Courses Forum Jobs Trendz FAQs  
     Explore The World of Hana With Us     
About Us
Contact Us
 Apps
X
HANA App
>>>
Hadoop App
>>>
Tutorial App on SAP HANA
This app is an All-In-One package to provide everything to HANA Lovers.

It contains
1. Courses on SAP HANA - Basics, Modeling and Administration
2. Multiple Quizzes on Overview, Modelling, Architeture, and Administration
3. Most popular articles on SAP HANA
4. Series of Interview questions to brushup your HANA skills
Tutorial App on Hadoop
This app is an All-In-One package to provide everything to Hadoop Lovers.

It contains
1. Courses on Hadoop - Basics and Advanced
2. Multiple Quizzes on Basics, MapReduce and HDFS
3. Most popular articles on Hadoop
4. Series of Interview questions to brushup your skills
Apps
HANA App
Hadoop App
';
Search
Stay Connected
Search Topics
Topic Index
+
-
SAPUI5 Overview
+
-
SAP Fiori Overview
+
-
SAP Web IDE
+
-
SAPUI5 Basic Concepts
+
-
Data Binding and Model

Understanding Namespace in SAPUI5

In this article we will explain how SAPUI5 namespace works.

Note: If you are new to SAPUI5, we recommend you to read below articles.

What is namespace in SAPUI5?

Namespace refers to project root folder location. Throughout the application, whenever there is a need of accessing root folder we can use namespace.

Understanding Namespace in SAPUI5

Let's understand this with the help of an example. In the article SAPUI5 Hello World using Web IDE we created SAPUI5 Hello World application. Please open that.
Note: If you have not created the Hello World application mentioned above, refer to the online example of SAPUI5 Hello World application. Please note that this link may not work in IE browser.

Namespace is declared in index.html file
Open index.html file and check bootstrap script. In bootstrap script, namespace is defined via attribute "data-sap-ui-resourceroots" as shown below.

Understanding Namespace in SAPUI5

In the above example namespace name is "saphanatutorial". You can give any name to your namespace.
  data-sap-ui-resourceroots='{
      "saphanatutorial": "./"
  }'

How namespace is used to refer to any file?

The namespace declared in index.html file, is used to refer to any file in the project.
In our Hello World example, controller file name is "HelloWorld.controller.js" and is saved under folder called "controller". Hence controller file can be referred as follows
saphanatutorial.controller.HelloWorld

Understanding Namespace in SAPUI5

Open the View and Controller file and crosscheck how controller is referred.
Controller

Understanding Namespace in SAPUI5

View

Understanding Namespace in SAPUI5

Note: In case of creating a project from template in SAP Web IDE, you need to specify the namespace as below. Based on the namespace specified there, index.html file is be generated.

Understanding Namespace in SAPUI5


Namespaces in XML Views

Apart from the global namespace defined in index.html file, XML view also XML namespaces.
This XML namespaces are mapped to SAPUI5 control libraries. One of the required namespaces is defined as default namespace. The control tags for this namespace do not need a prefix.

For example, in below SAPUI5 View,
"sap.m" library is mapped to default namespace
"sap.ui.core.mvc" library is mapped to "mvc" namespace

Understanding Namespace in SAPUI5

When a control is specified in View, control tag for the namespace is added as prefix, except for default namespace.

Understanding Namespace in SAPUI5

What's Next?

Below articles might help you to know more about SAPUI5.

If you have any question, please post in the comment or contact us.




Support us by sharing this article.



Explore More
Close X
Close X

Leave a Reply

Your email address will not be published. Required fields are marked *

Current day month ye@r *

 © 2017 : saphanatutorial.com, All rights reserved.  Privacy Policy