Skip to main content
code formatting
Source Link
martin
  • 12.7k
  • 10
  • 50
  • 75

Supporting @Menzman's solution, changing to an Application event in the interim will resolve this.

Once thing to watch out for however is to make sure you remove the name attributes from the handlers, otherwise they won't work.

So your handler would be:

<aura:handler event="someEvent" action="{!c.someEventHandler}"/>

And firing the event would look like:

// action for a button
someAction : function(component, event, helper){
    var someEvent = $A.get("e.c:someEvent");
    someEvent.fire();
    console.log("save event fired");
}

someAction : function(component, event, helper){ var someEvent = $A.get("e.c:someEvent"); someEvent.fire(); console.log("save event fired"); }

The event handler will remain unchanged.

Supporting @Menzman's solution, changing to an Application event in the interim will resolve this.

Once thing to watch out for however is to make sure you remove the name attributes from the handlers, otherwise they won't work.

So your handler would be:

<aura:handler event="someEvent" action="{!c.someEventHandler}"/>

And firing the event would look like:

// action for a button

someAction : function(component, event, helper){ var someEvent = $A.get("e.c:someEvent"); someEvent.fire(); console.log("save event fired"); }

The event handler will remain unchanged.

Supporting @Menzman's solution, changing to an Application event in the interim will resolve this.

Once thing to watch out for however is to make sure you remove the name attributes from the handlers, otherwise they won't work.

So your handler would be:

<aura:handler event="someEvent" action="{!c.someEventHandler}"/>

And firing the event would look like:

// action for a button
someAction : function(component, event, helper){
    var someEvent = $A.get("e.c:someEvent");
    someEvent.fire();
    console.log("save event fired");
}

The event handler will remain unchanged.

Source Link

Supporting @Menzman's solution, changing to an Application event in the interim will resolve this.

Once thing to watch out for however is to make sure you remove the name attributes from the handlers, otherwise they won't work.

So your handler would be:

<aura:handler event="someEvent" action="{!c.someEventHandler}"/>

And firing the event would look like:

// action for a button

someAction : function(component, event, helper){ var someEvent = $A.get("e.c:someEvent"); someEvent.fire(); console.log("save event fired"); }

The event handler will remain unchanged.