Communication between presenters using a different event bus / Paypal Integration

98 views
Skip to first unread message

Sydney

unread,
May 17, 2012, 5:29:47 PM5/17/12
to gwt-pl...@googlegroups.com
I am integrating Paypal to my site. When a user wants to buy using Paypal, he clicks on a button that displays the paypal website in a lightbox (iframe). When the user is done with its purchase, paypal redirects in this iframe to a url. I set the URL to something like http://www.example.com/App.html#!myPlace;return=true;id=154

In the prepareFromRequest I processed the parameters. The issue is that the presenter in which the user clicks the button, and the presenter in the iframe after the redirection are different. The one in the iframe is a new one. Presenters are singleton but since the redirection is in an iframe, I guess that's why a new instance is created.

I would like to communicate from the presenter in the iframe to the one outside the iframe. I tried using events but the handler is only executed in the iframe presenter. I suspect that in the iframe a new event bus has been created.

In other words
The start place is http://www.example.com/App.html#!myPlace, on this page user clicks the button, a paypal iframe is created.
Paypal redirects to http://www.example.com/App.html#!myPlace;return=true;id=154 in the iframe. At this moment I have 2 different instances of MyPlacePresenter (associated with !myPlace).
The goal is to talk to the start place presenter from the iframe presenter knowing that they don't share the same event bus.

Any ideas?

Christian Goudreau

unread,
May 19, 2012, 3:31:01 PM5/19/12
to gwt-pl...@googlegroups.com
What is run in a iFrame is run in a different context of the rest of your app and that is how iFrame works.

You can access the iFrame data from your webpage and you webpage from the iframe if the source is in the same domain, but you'll need to use JSNI.


--
Christian Goudreau
Reply all
Reply to author
Forward
0 new messages