cancel
Showing results for 
Search instead for 
Did you mean: 

Images not showing in SAPUI5 application after deployed in FIORI launchpad.

8,063

Hi,

I'm working in SAPUI5,

I have images in folder like structure

and in App.xml i wrote code like,

while running as web application and in sandbox it showing images

but in launchpad it not showing images.

Please help me on this.

Thanks and regards,

Ajit B.

View Entire Topic
ugurkaya
Active Participant

Hey Ajit & Jay,

If you are running your application on the launchpad and having root problems:

Try this in your component.js onInit()

Basically we create a model to get resource root of the application when we want to display images

var oRootPath = jQuery.sap.getModulePath("com.kaya.app001"); // your resource root
		
var oImageModel = new sap.ui.model.json.JSONModel({
	path : oRootPath,
});
		
this.setModel(oImageModel, "imageModel");

Change your image source according to this:

<Image src="{imageModel>/path}/test-resources/Icons/twitterIcon.png" />

Regards

Ugur

jmalla
Contributor
0 Kudos

I had the same issue - the images work fine running the application from HCP but are not working when launching from the Fiori launchpad.

jmalla
Contributor
0 Kudos

Did you find the answer to this?