Images folder contain many images like xxx.png, yyy.png, etc.
Image src="./images/xxx.png" works very well when I am testing and after deploying to SCP. But, the same doesn't work when I register the app to Launchpad and open it from there. Why does the images don't load?
I see the following the in the network:
Component.js is getting loaded from
https://xxxxxx-yyyyy.dispatcher.eu3.hana.ondemand.com/sap/fiori/workbox/Component.js?ts=1.0.143 with 200 status
But the images are trying to get load from
https://xxxxxx-yyyyy.dispatcher.eu3.hana.ondemand.com/images/xxx.png
https://xxxxxx-yyyyy.dispatcher.eu3.hana.ondemand.com/images/yyy.png which results in 404. Instead the hit should I have been on the following url.
https://xxxxxx-yyyyy.dispatcher.eu3.hana.ondemand.com/images/sap/fiori/workbox/images/xxx.png
I tried changing the Image src to src="./images/xxx.png" and src="/images/yyy.png". But, same old URLs are hit and results in 404.
Why does this happen so? Why does component.js and images are loaded from different root? I found many answers suggesting to use jQuery.sap.getModulePath("com.xxx.Component") but that didn't help me the least. It returned me https://sapui5.hana.ondemand.com/resources/com/xxx/Component which is of no use.