[ 2 posts ]

Raphaël Bauduin

  • Username: raphinou
  • Joined: Thu Nov 26, 2009 7:03 am
  • Posts: 39
  • GitHub: raphinou
  • Gists: raphinou
  • IRC: raphinou
  • Offline
  • Profile

Cross sandbox communications

Post Posted: Fri Feb 19, 2010 8:34 am
+0-
HI,

I have one widget in one sandbox that needs to notify another widget in a different sandbox to refresh its data.

I tried to fire a custom event from the first sandbox:
Code:
Y.fire('entity_created', 'list_id', data  );


And listen in the second sandbox:
Code:
  Y.on('entity_created', function(list, data) {
      console.log('envent logged');
  }); 


But nothing is logged.

When I define the event listener in the first sandbox, it works fine. Both sandboxes use 'event-custom'.

Was I mistaken to think that events spread across sandboxes. If that's not the case, how can I set up communications between sandboxes?
(I'm nearly sure I read something about that, or saw it mentioned in a video, but I don't find it back....)

Thanks

Raphaël

Satake

  • Joined: Tue Jul 07, 2009 9:15 am
  • Posts: 51
  • Offline
  • Profile

Re: Cross sandbox communications

Post Posted: Fri Feb 19, 2010 8:41 am
+0-
You can use the global event target, I think this thread mentions it.

viewtopic.php?p=8125

Basically set up an event in one sandbox and tell it to broadcast, then in another sandbox go
Y.Global.on('the event you setup')
to catch it.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum