Skip to Content

Unable to interact with iFrame in SAPUI5 App

Hi Friends,

I have embedded an iFrame in sapui5 app but unable to interact with any element in it. Any suggestions for the same?

<Page id="page" title="{i18n>title}" showHeader="false">
    <content>
          <html:iframe width="100%" height="100%"  src="xxxxxxxxxx"></html:iframe>
    </content>
</Page>

Regards

Anmol

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Apr 03 at 07:40 PM

    if you have errors in console about "permission denied" then probably your iframe is from different origin. not sure but it seems to be security feature. difficult to say without seeing what is in console

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 05 at 07:38 PM

    The application in the IFrame itself also has to allow interaction. It could be that it only triggers events to apps running in the same domain. This depends on the app in the iframe...

    If you try to access Dom elements in the iframe, make sure that you are using the right id’s. Have you tried the following: https://stackoverflow.com/questions/1088544/get-element-from-within-an-iframe

    In UI5 you will need to use the byId function to get the iframe control and the getRefDom (correct me if I’m wrong) to get to the Dom element of the iframe. From here you can try to access other Dom elements in the iframe.


    Kr, Wouter

    Add a comment
    10|10000 characters needed characters exceeded