Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

An example to learn how fullScreenPageRoutes works in full screen application via debugging

$
0
0

In CRM Fiori there is a full screen application named My Task.

Note: This "full screen" has nothing to do with F11 in your browser.

clipboard1.png


My colleague today asked me one question: what is the usage of this attribute "fullScreenPageRoutes"?

clipboard2.png

If google this attribute as keyword, there are not so many useful result returned. How to do self study on this attribute via debugging?

 

Open Development tool and perform global search via Ctrl+Shift+F, click line 156 and set a breakpoint there. Refresh the application.

clipboard3.png


Debugger is triggered. We can find that the route information we set in Configuration.js are loaded and stored in variable oAppMeta accordingly.

clipboard4.png

Where does this oAppMeta come from? Click the blue callstack frame. Here a metadata instance is created with type "FS" ( fullscreen ), and the whole configuration data wrapped by { } is passed into function createMetaData as second argument, that is, oAppMeta within createMetaData function. 

clipboard5.png

Since the application has type "FS", so oMeta.routing is hard coded as below in ComponentBase-dbg.js. The routing object has attribute "routes" which is again an object which has another object attribute "fullScreen".

clipboard6.png

clipboard7.png


clipboard8.png

Then later when UI Component is being initialized, the merged route information is stored in private attribute _oRouter of application UI component in line 218.

clipboard9.png

The view marked with blue "sap.ca.scfld.md.view" will be used in _routeMatched:

clipboard9.png


clipboard10.png

This is the reason why you can observe the load of corresponding xml file in Chrome network tab:


clipboard11.png

clipboard12.png

Since when I launch this Fiori application locally in my Tomcat with url: http://localhost:8090/cus.crm.mytasks/, no hash is appended after url, so route configuration with target view S2 is chosen:


clipboard13.png

clipboard14.png

The view hierarchy could be found below:

clipboard15.png

And if I change the attribute name deliberately, I can only see a blank screen:

clipboard16.png

Compare the new view hierarchy this time:


clipboard17.png

The reason is quite simple if we understand previous analysis. This time the route data provided by application fails to be merged, since line 261 expects attribute fullScreenPageroutes but I only have "fullScreenPageroutesAAAAA".

clipboard18.png

In console you can see warning message which complains application didn't provide any page to display.

clipboard19.png


Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>