cancel
Showing results for 
Search instead for 
Did you mean: 

Image source folder not loading

BenedictV
Active Contributor
0 Kudos

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) -

https://webidetesting2925709-p935244trial.dispatcher.hanatrial.ondemand.com/BW_App_Delete/resources/...

I hope I have detailed all the necessary information.

Thank You,

Benedict

Accepted Solutions (1)

Accepted Solutions (1)

Joseph_BERTHE
Active Contributor
0 Kudos

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

BenedictV
Active Contributor
0 Kudos

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.

Answers (3)

Answers (3)

haemma83
Active Participant
0 Kudos
haemma83
Active Participant
0 Kudos

Hi,

I've the same issue - I have images liying under /webapp/img/..

In de WebIDE I can see the pictures under the path:

https://webidetesting1050483-abd164b39.dispatcher.hana.ondemand.com/~1623856645000~/webapp/img/voest...

After deployment the framework seeks for the images at:

/sap/bc/ui2/img/*

How do I have to change the config?

Thanks.

BenedictV
Active Contributor
0 Kudos

Hi Andreas, this thread is from 5years ago. I cant recall what I was trying to do at the time with this.

You will have better luck if you post a new question.

junwu
Active Contributor
0 Kudos

use relative path