Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SAPUI5 load image in Fiori app, image path was changed

i am trying to load a image in my fiori app. The image is located in /webapp/img/greendot.jpg like this:
enter image description here

But then i deploy my app to my ABAP-Repository the path changed to:

https://<server>:<port>/sap/bc/ui5_ui5/sap/my_application/~CD103454ACB782CF74F8A2339BE67CE1~5/img/greendot.png

How can i get this path so i can load my image?

like image 613
www40 Avatar asked Jan 08 '23 07:01

www40


1 Answers

Then you are loading it wrong, you should reference the SRC-property to your relative path: "/img/greendot.png" or try "./img/greendot.png"

var img = new sap.m.Image({
   src : "./img/greendot.png",
});

there is no need during runtime to request any backend-paths...

like image 95
dotchuZ Avatar answered Jan 23 '23 02:01

dotchuZ