• 4 replies
  • Latest Post - ‏2013-10-10T22:26:32Z by JBASkeen
2 Posts

Pinned topic Communication with RUI

‏2013-08-27T09:57:28Z | communication iframe rich rui ui



I'm in the middle of creating a web-portal where part of the applications running in it will be Rich UI.

It will be a pretty mixture of old and new Java web-apps mixed with javascript and old legacy apps enabled by Rational HATS and then Rich UI applications.

They are all running in different iframes.


Anyone have any experience with communicating back and forth to a RUI?


Could be pretty need to use the InfoBus, but it seems that the version incorporated into EGL Rich UI does not support Iframe communication.





  • Smyle Z. Huang
    Smyle Z. Huang
    13 Posts

    Re: Communication with RUI


    Hi Thomas,

    InfoBus is mainly used for communication across publisher & subscriber  in one web page. 

    In your circumstance, it is communication across web page (each iframe is an individual web page), so personally thinking it is not supported.

    To communicate across iframes:

    Firstly you need to ensure not to break the same original policy rule, i.e., the parent window and child iframe stays in the same subdomain, which generally prohibits communication across iframes. 

    Then if it is so I think you can write a simple EGL external type in JS to expose a simple communication interface based on your business requirement.

    Finally, there is another alternative to make it work. You can write a service pushing & polling updates from server in different iframes. This is the most common way to do it.

    These are my thoughts. if there are mistakes, feel free to correct me. Hope it helps. :)



  • Ortwin
    209 Posts

    Re: Communication with RUI


    Hello Thomas,


    In the following example by Chris Laffra a fix on the InfoBus is used to make it pass the iFrame borders.

    We use this fix in our application and it works fine. It even passes browser tabs. So be careful when your application is started twice; without taking special caution the two instances of the application will interfere.



  • TJuul
    2 Posts

    Re: Communication with RUI




    Thanks to both of you for sharing your thoughts and solutions.


    @Ortwin - I will definitely give Chris fix a go.


    Otherwise I have been thinking about using HTML5 postMessage generally in the portal and then create a bridge between RUI (InfoBus) and the outside (postMessage) world.



  • JBASkeen
    137 Posts

    Re: Communication with RUI


    Although I am needing to explore the world of InfoBus more and more recently, I have previously declared RUIs within RUIs, which creates a scenario where you have a "Driver" RUI. Using Libraries across embedded RUIs works well too to keep them in "sync".  We have had a lot of success with this method but that kind of model can introduce its own complications.