cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

UI5 Components: Component-preload.js

js2
Product and Topic Expert
Product and Topic Expert
0 Likes
17,478

When using Components in UI5 apps I can see a stray GET request each time the application is loaded looking for Component-preload.js in the app directory.

There is a little bit of explanation on preloading in the SDK help (but not much). From what I can gather: library pre-loading is something thats only applicable to the SAP-provided UI5 libraries. Our own code can't execute till the UI5 libraries are loaded anyway

I've tried setting data-sap-ui-preload="async" (sync is the default); but then UI5 won't load. Interestingly if I set sap-ui-preload=auto as a url query string parameter; the app seems to load normally (sync) and there is no stray GET on the Component-preload.js file.

Does anyone have any further information on pre-loading and why there is a GET request on this file and the best way to stop it.

If you also know how to stop all the message bundle GET's that would be interesting to know as well.   😉

View Entire Topic
Former Member
0 Likes

HI Gurus,

I am getting the same error Please help.

launchdashboard is my initial view

component.js

------------------------------------------

jQuery.sap.declare("ZGreenfield.Component");

sap.ui.core.UIComponent.extend("ZGreenfield.Component", {

  createContent : function() {

  // create root view

  var oView = sap.ui.view({

  id : "App",

  viewName : "ZGreenfield/greenfield_refinery.launchdashboard",

  type : "JS",

  viewData : { component : this }

  });

// // Using OData model to connect against a real service

// var url = "/proxy/http/<server>:<port>/sap/opu/odata/sap/ZGWSAMPLE_SRV/";

// var oModel = new sap.ui.model.odata.ODataModel(url, true, "<user>", "<password>");

// oView.setModel(oModel);

  // Using a local model for offline development

  var oModel = new sap.ui.model.json.JSONModel("jsonFiles");

  oView.setModel(oModel);

  // done

  return oView;

  }

});

--------------------------------------------

index.html

----------------------------------------------

<!DOCTYPE HTML>

<html>

  <head>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>  

  <script

  id="sap-ui-bootstrap"

  src="resources/sap-ui-core.js"

  data-sap-ui-theme="sap_platinum"

  data-sap-ui-libs="sap.ui.commons,sap.ui.table,sap.suite.ui.commons,sap.viz"

  data-sap-ui-resourceroots='{

  "ZGreenfield": "./"

  }' >

  </script>

  <script>

  new sap.ui.core.ComponentContainer({

  name : "ZGreenfield"

  }).placeAt("content");

  </script>

  

  </head>

  <body class="sapUiBody" role="application">

  <div id="content">

  </div>

  </body> 

</html>

-----------------------------------------------

Many Thanks

Pandu