UI5 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.
Output:
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.
Output:
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.
Output:
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.
Output: