Skip to Content
avatar image
Former Member

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

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.

imgstru.png (3.2 kB)
imgstrucode.png (7.9 kB)
imgstrucode.png (7.9 kB)
webappimage.png (12.6 kB)
flpimage.png (14.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 02, 2017 at 06:59 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 02, 2017 at 04:19 AM

    Did you find the answer to this?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

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