Skip to Content
0
May 08, 2020 at 05:12 PM

SAPUI5 iFrame src-Path

412 Views

Hi everybody,

I have a sapui5-app and I would like to call a html-page using an iframe.

I begin with a start.js. Both files start.js and the viewer.html sitting in the same folder /pdf/web

var oiFrame = new sap.ui.core.HTML({content: "<iframe id='pdfViewer' src='/pdf/web/viewer.html' style='width: 100%; height: 700px;' allowfullscreen='' webkitallowfullscreen=''</iframe>" });

If I use the WEBIDE, the HTML-page is correctly loaded.

However, after deployment, the viewer.html is not found, because the app is loading it from a complete wrong place.

It should be loaded from:

http://domain.com:PORT/sap/bc/ui5_ui5/namespace/app/~EBB10196E937C17BB58FB508D8D9774B~5/pdf/web/viewer.html

, however it loads from: http://domain.com:PORT/pdf/web/viewer.html

How can I feed the correct path into the iframe? Is there a javascript function to retrieve the correct path?

Thank you very much for your help