on 04-07-2016 4:29 PM
Hi,
I imported my BUILD project into SAP Web IDE and I am able to successfully run it as a web application.
But, the images do not seem to load. I am new to the whole web development space and am trying to learn things on my own and from the openSAP Fiori course. I did some research on my own before coming here and here's what I found so far,
The images are located inside the "resources/thumbnail" folder
but, when I look in the source tab of developer tools in chrome, I do not see the 'resources' folder,
I am using the layout editor for the /view/xxx.view.xml and in the image 'src' input I have given the path for the image as, /BW_App_Delete/resources/thumbnail/chain.jpg (I believe this is the absolute path for the image).
I get the following error when I do a 'Inspect Element' on the image after the page is loaded,
Failed to load resource: the server responded with a status of 404 (Not Found) -
I hope I have detailed all the necessary information.
Thank You,
Benedict
Hello,
Your issue comes from the path. If you have done rigth thing you should have access to your image with :
url : 'resources/thumbnail/chain.jpg'
Try this, and if it doesn't work check in your index.html if you have put something like this :
data-sap-ui-resourceroots='{"blabl.blal.myProject": "./"}'
Regards,
Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Joseph for your suggestions.
Changing the path itself did not work, but I checked the index file for 'data-sap-ui-resourceroots' and it was available. I did some search and came across this thread,
http://stackoverflow.com/questions/25719860/how-load-all-local-resource-in-a-specific-directory
and so added the thumbnail folder path to 'resourceroots' in a separate line and now my images are displayed properly and I am able to see the folder under source tab in developer tools.
One thing though. I removed the newly added line from the code now, and still my images are loaded properly.
Hi Benedict,
I did so - please see:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I've the same issue - I have images liying under /webapp/img/..
In de WebIDE I can see the pictures under the path:
After deployment the framework seeks for the images at:
/sap/bc/ui2/img/*
How do I have to change the config?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use relative path
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.