Skip to Content
avatar image
Former Member

Fetch control of outer application in inner iframe

Hi,

I have created a tool page with its main content as iframe. I have a popover on header of toolpage. I want to close this popover automatically when a click happen on page.Its working fine on header , side menu and footer part except main content which is iframe. iFrame consist of different application in different package .I have implemented window event listener for click but i am unable to fetch any reference of popover in this application

Is it anyway possible to fetch control popover in other application so I can use the close method of contorl?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 15, 2017 at 04:54 AM

    Can you post some code to verify you do the rigth things ;) ?

    Regards,

    Joseph

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Currently I am using below code. I am only able to fetch DOM

      window.addEventListener('click', function(e){

      if(window.parent.document.getElementById('id.popover') && document.activeElement=== document.querySelector('body')){

      window.parent.document.getElementById('id.popover').style.display='none';

      } });

      To create iframe I am using-

      this.getView().setBusy(true);

      var content = pageRef.getMainContents();

      var src; if(tab === 'CS'){

      src = 'source of other application'; }

      else if( tab=== 'TM')

      src = "'source of other application";

      pageRef.destroyMainContents();

      var iframe = new sap.ui.core.HTML({width:'100%' ,height:'100%'});

      iframe.setDOMContent(this.doCreateIFrame(src)); // docreateFrame create the frame according to source

      pageRef.addMainContent(iframe); // add to toolpage

      },