Topic
4 replies Latest Post - ‏2013-10-10T22:26:32Z by JBASkeen
TJuul
TJuul
2 Posts
ACCEPTED ANSWER

Pinned topic Communication with RUI

‏2013-08-27T09:57:28Z |

Hi

 

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.

 

Thanks...

 

/Thomas

  • Smyle Z. Huang
    Smyle Z. Huang
    13 Posts
    ACCEPTED ANSWER

    Re: Communication with RUI

    ‏2013-08-28T09:00:32Z  in response to TJuul

    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. :)

    Regards

    Smyle

  • Ortwin
    Ortwin
    177 Posts
    ACCEPTED ANSWER

    Re: Communication with RUI

    ‏2013-09-04T19:34:19Z  in response to TJuul

    Hello Thomas,

     

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

    https://www.ibm.com/developerworks/community/blogs/3e2b35ae-d3b1-4008-adee-2b31d4be5c92/entry/developing_a_portal_using_egl_rich_ui_bending_the_laws_of_physics?lang=en

    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.

     

    Ortwin

  • TJuul
    TJuul
    2 Posts
    ACCEPTED ANSWER

    Re: Communication with RUI

    ‏2013-09-05T07:14:48Z  in response to TJuul

    Hi

     

    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.

     

    /Thomas

  • JBASkeen
    JBASkeen
    131 Posts
    ACCEPTED ANSWER

    Re: Communication with RUI

    ‏2013-10-10T22:26:32Z  in response to TJuul

    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.

    James