cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 XML View vs JS view

Former Member
0 Kudos
868

Hello ,

I have found a very common issue which many of you also have faced , specially people who are using javascript

view to design the UI5 front end.

There is wonderful tools like :Fiori Fast Design

And also the OpenUI5 SDK - Demo Kit which shows how to design XML views.The only hope we(JS view Dev. community) are having is the SAPUI5 Developer Guide , OpenUI5 SDK - Controls and google off course.

Have anyone come across any way by which we can convert the XML views to JS views.

I have seen App designer as well and it is quite impressive but when we are talking about attention to details then I come back

to the regret that why I did not select the XML view radio button in my hello world and decided to stick with JS view instead....:

-Warm Regards

Ajay Nayak.

View Entire Topic
sivakumar_mobility
Active Participant
0 Kudos

Hi Ajay,

I am also a fan of JS based views. Possible (dis)Advantages are in my eyes:

Advantages for JS

  • Object oriented creating of the view. You can create objects, arrange them, call methods on them and use any JavaScript function you want (e.g. loops)
  • For my taste, SAPUI5 XML based view seem to be a little too implicit. In JS, I can cleary read out of the coding what I am doing.
  • Pages can be dynamic
  • You stay in JavaScript all the time

    Disadvantages for JS  which is advantage in XML: 

  • XML favours a strict seperation between view and logic. Your are forced to use external formatters for example. I think XML views might be cleaner.
  • SAP ships all Fiori apps using XML views. So, you are a little forced to have atleast the knowledge in how to read XML based views.
  • You might have less lines of code in XML

  XML disadvantages: 

  • bad readability
  • modifying existing views is trickier at times
  • quite implicit, bad if you care about what is happening behind the scenes

I hope above explanation will give you better understanding to you.

with reagrds,

siva.

0 Kudos

I have started to work with sap ui5 recently may be 1 month and I saw that XML views are simpler and easier to manipulate. May be this is about my lack of Javascript knowledge but I have struggled on FlexibleColumnLayout because I could not access rootControl from JS view and turn it to XML. Also XML view can accept some properties that JS does not accept like adding sort for m.Table easily. JS views take more effort on creating pages.

As a result for now XML views is a hero for me but I will work on JS and may be more I learn about JS more I will like JS and see how efficient it is:)