on ‎2016 Jan 04 9:00 AM
Hi,
I am currently trying to improve the performance of my app by loading a Component-preload file. I am following a similar method as in this post
When I started working on my app, I removed the "cannot load Component-preload file" error by inserting the data-sap-ui-preload="" line in my index.html file. The problem that I am facing now is that I cannot get back to the state where it complains about not finding the preload file. I removed the data-sap-ui-preload="" line from my index file, yet the GET request for the preload file is still missing. While inspecting my network tab in chrome, I can see that it does load library-preload files, but the component-preload GET request is nowhere to be found.
Is there something else that I forgot about to enable the loading of a component-preload file? Just to clarify, Generating a Component-preload file is not my current problem, the problem is I want my app to complain about the missing preload file again. I know this seems weird, but once it complains, I can give it my preload file and take it from there.
I am running SAPUI5 v1.28
Regards
Albert Volschenk
Request clarification before answering.
HI,
I've found my problem. In my index.html file where I created my app's shell, There was a stray line of code which included the Component file. I guess it altered the way in which the component file loads the preload files.
Lessons learnt:
jQuery.sap.require("myNamespace.Component"); Should NOT be in your index.html file
Thanks for everyone that tried to help
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to give some idea of what my code looks like:
in my index.html I have:
<head>
<script id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ui.unified"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{"myNamespace":"./"}'
data-sap-ui-preload="sync">
In chrome I get the follwing:
I created a test project a while back, and it seems to be working correctly there. The bootstrap:
<script id="sap-ui-bootstrap"
src="resources/sap-ui-core.js"
data-sap-ui-libs="sap.m"
data-sap-ui-xx-bindingSyntax="complex"
data-sap-ui-resourceroots='{"myNamespace": "./"}'>
it gives the following output:
So I know I can generate and load a correct Component-preload file, its just in my main project it doesn't even try to load it.
I can't seem to find the difference between the project's bootloaders (removing the preload="sync" in my main project doesn't do anything), please let me know if I should supply any particular code in my project.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try adding sap-ui-core-all.js in your bootstrap instead of sap-ui-core.js?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I primarily work in IntelliJ, and it did not load the component-preload file there. So I quickly switched back to eclipse just to test if it works there (which it didn't ).
Do you think it might be something to do with my proxy setup in my component file? It seems to be the only main difference between my apps that load the preload file and the apps that don't.
Regrads
Hi,
1) I'm a bit confused on how I should setup a proxy in eclipse? I currently have the following in my web.xml:
then I just run my app as a web App in eclipse (in IntelliJ I run it on my Tomcat server). Is there a different method of setting up a proxy to work with ui5?
2) Yea, when I'm testing in Eclipse I run it as a webApp and when I'm working in intelliJ I run it on Tomcat. I moved an app, that loads the preload file correctly, from eclipse to IntelliJ and it worked on both. So I don't think its a problem with my setup (since the working app works on both platforms), I think its something in my Application settings itself. I forgot that I created the base of my app (that doesn't work) in the web IDE, so I'm currently exploring the possibility that the web IDE may have disabled component-preloadng...
Regards
Hi
Maybe the browser cache the old code you wrote. Please clear the cache ans history and try again.
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey,
maybe data-sap-ui-preload="sync" helps?
Regards
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.