cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 App resources not loaded from fiori Launch Pad

Former Member
0 Kudos

Dear Mentors ,

I am trying to place my custom app in the fiori in the launch pad,

The app loads the images and the local model data from the project folders perfectly fine , when the app is launched separately from the SAP server .

But when the same is launched from fiori launch pad , the resources are not loaded,

Not sure the coding has to be changed or any specific setting has to be done while  configuring the app with FLP.

I have uploaded the example Fiori app to the SAP server and the project folder structure in SE80 is like below screen shot,

Kindly help on the same ,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Am also facing same issue. In my app .css is getting loaded properly but image path is not working. Can any one pls tell me that how to include the images path in component.js . or is there any other way to achieve the same...

-Mahi

Former Member
0 Kudos

Hi Mahindran,

I have resolved my image and local json file issue by using  the below code ,

// Image loading     

var sRootPath = jQuery.sap.getModulePath("demo");     

var sImagePath = sRootPath + "/image/photo1.png";    

var image = new sap.m.Image({ src: sImagePath })

// Resource Bundle

var i18nModel = new sap.ui.model.resource.ResourceModel({  bundleUrl : [sRootPath, "i18n/messageBundle.properties"].join("/") });

oView.setModel(i18nModel, "i18n");

// Local Json file

var ojsModel = new sap.ui.model.json.JSONModel([sRootPath, "model/mock.json"].join("/"));

oView.setModel(ojsModel, "data"); 

Hope this helps ,

This would work as standalone UI5 application  and embeded Fiori Launch pad app as well

Regards
Deepak

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Deepak,

Where are you specifying the libraries?

It could go as the metadata in your component.js file.

metadata : {

includes: [

            "css/file1.css",

            "css/file2.css",

                     ],

            libs: [ "sap.ui.commons", "sap.suite.ui.commons", "sap.ui.unified", "sap.ui.layout", "sap.ui.ux3"],

            config: {

            fullWidth : true

            }

}

Refer this link ->SAPUI5 SDK - Demo Kit

Regards,

Naren L Naik

Former Member
0 Kudos

Hi Naren ,

Thanks for replying,

For example , i have a folder called image under the WebContent folder of my project ,

I have an logo in the location image/Logo.png,

1) The same has been mentioned in my view as

var image = new sap.m.Image({ src: "image/Logo.png" })

2) And the index .html has a root folder set as below ,

data-sap-ui-resourceroots='{ "zflight_demo": "./" }'>

3) My component container i.e Component.js  have been updated now with

metadata : { includes: [             "image/"                     ],

Still the logo is not loaded from Launch pad , but the same seems to be working fine from eclipse or SAP server as standalone application ,

Could you please guide me with some steps , thank for your help in advance .

Former Member
0 Kudos

Hi,

try using

var image= new sap.m.Image({

  src: $.sap.getModulePath("zflight_demo", "/image/Logo.png")  });


Regards,

Naren L Naik

karthikarjun
Active Contributor
0 Kudos

I hope this thread will help you. https://scn.sap.com/thread/3768230

Regards,

Karthik A