Skip to Content
1
Jul 16, 2014 at 09:25 AM

Inline XMLViews into component-preload.js

402 Views

Hi,

after reading some code & some posts on SCN I managed to write a simple grunt task that combines my components javascript code into a single component-preload. This works (or seem to work).

But I'd really like to include the views into this file, too.

I tried to inline them with sap.ui.xmlview(viewName, { viewContent: xmlSource }) but UI5 sends XHR requests anyways. Looking into the source for sap.ui.core.mvc.XMLView it seems to always send a request when a new view is instantiated. Is there a way to load/inline the view content once and use that for further instantiation?