SAP UI5 Different Views

light111UI5 Views


There are 4 different views in SAP UI5 and these are:

1-XML View, 2-JavaScript View, 3- JSON View, 4- HTML View

Below post shows just a simple use case of how to design a simple control(Text control) in each of the view.


XML View:

Create a SAP UI5 application and select creating a XML view.

In the content section of the view  add control:

<Text xmlns=”sap.m” id=”T1″ text=”Hello World”/>

Save and run the app by selecting the Index.HTML file.

1

Output:

2


JS View:

Create a SAP UI5 application and select creating a JS view.

In the CreateContent section  add control as below

var oText = new sap.m.Text( “T1”, {text : “Hello World”} );<Text xmlns=”sap.m” id=”T1″ text=”Hello World”/>

and then pass the control object “oText” in the page content section

Save and run the app by selecting the Index.HTML file.

3

Output:

4


JSON View:

Create a SAP UI5 application and select creating a JSON view.

In the page content section fill the details as a name-value pair.

“Type”:”sap.m.Text”,
“id”:”Id1″,
“text”:”Hello World”

Save and run the app by selecting the Index.HTML file.

5

Output:

6


HTML View:

Create a SAP UI5 application and select creating a HTMLview.

In the DIV content section put the below details:

<div data-sap-ui-type=”sap.m.Text” id=”T1″ data-text=”Hello World”></div>

Save and run the app by selecting the Index.HTML file.

7

Output:

8


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s