Lightning events between Lightning Components and Skuid pages

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Has anyone done anything with broadcasting events between Lightning Components and a Skuid page embedded together in a Lightning App? For example:

<aura:application>
  <c:myComponent/>
  <skuid:page name="MySkuidPage"/>
</aura:application>

Two questions really:
1. Is it possible for myComponent to emit events that can be received in MySkuidPage?
2. And can MySkuidPage emit events that can be received in myComponent?

This page suggests it should be possible, though having used the code (with some slight modifications to call my own event) in an app similar to the above, there's an error "Uncaught SecurityError: Blocked a frame with origin "https://{mydomainhere}.lightning.force.com"; from accessing a cross-origin frame." I think this may be the LockerService restrictions. I've tried rolling back the API versions of the components to v35, but I get the same error message.

Has anyone experimented with this or have thoughts on if it is possible? 
Photo of Gary

Gary

  • 1,518 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,648 Points 20k badge 2x thumb
Gary, have you tried to communicate using Lightning Application Events, or are you using Component-events? My understanding is that even with LockerService, Application Events are still published between Components (see FAQ question here). 
Photo of Gary

Gary

  • 1,518 Points 1k badge 2x thumb
Hi Zach, yes it was Application Events. Could well be something I'm doing wrong, or some kind of setting I'm not getting right - the error wasn't the one I was expecting from LockerService, so it may well be something else.

Not had a chance to revisit it, and changed approach for now anyway. I'll try and re-do the POC at some point. Thanks for replying though - at least I now know it should be possible, so I'll put re-trying on my to do list.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,648 Points 20k badge 2x thumb
Official Response
Gary, in Skuid's Millau release, we added an extensive set of capabilities around use of Lightning Events with Skuid.

You can now use Events to perform all of the following directions of communication:

Skuid Page Lightning Component <--> Skuid Page Lightning Component
Skuid Page Lightning Component <--> Custom code Lightning Component

See the Millau release documentation on using Events to facilitate inter-component communication with Skuid:

https://docs.skuid.com/v11.0.0/en/skuid/salesforce/event-handling-lightning.html
Photo of Gary

Gary

  • 1,518 Points 1k badge 2x thumb
Tres chic! Thanks Team Skuid - hope you're having a great Dreamforce!