2

Is it possible to handle an application event outside from the managed package.

I have created a managed package which have an Lightning event and a Lightning component, the Lightning component is firing this application event on a click.

How can I handle this event in another component?

I have handled the event but it is not working.

My event

<!--c:aeEvent-->
<aura:event type="APPLICATION">
  <aura:attribute name="message" type="String"/>
</aura:event>

registering event in my controller

<aura:registerEvent name="appEvent" type="c:aeEvent"/>

these two codes belongs to a managed packages whose namespace is appe.

I am creating an component in another org where i have installed this managed package and in this component I am handling this event.

event handler

<aura:handler name="appEvent"  event="appe:aeEvent" action="{!c.handleApplicationEvent}"/>

but the function handleApplicationEvent is not getting invoked. please help.

1 Answer 1

7

This will most likely happen if you've either wrong access rules, namespace access or if the event is not registered properly. I would recommend checking the following

1) Is your component access attribute set to 'global'

2) Try to debug if your event handler was registered successfully using the <aura:registerEvent> call

You can read more about Namespace usage in Lightning Components here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .