• Sivakumar S C
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,

I am developing an application in salesforce lightning. I have a dashboard page and after clicking any menu it will navigate to particular component. I have created the header as a separate component and included in other components. I have action buttons for the body in header component. Let's say, I have a component A which has a user form and to save the form after filling these details i have "save" button in header component. To trigger the events i used a registered event in header components like below,

    <aura:registerEvent name="renewalPriceSaveEvent" type="ESRV:RenewalPriceSaveEvent"/>

And on button click i fired the event in header controller,

        var appEvent = $A.get("e.ESRV:RenewalPriceSaveEvent"); 
        appEvent.fire();

In body component i handled that event like this,

    <aura:handler event="ESRV:RenewalPriceSaveEvent" action="{!c.onSave}"/>

And called save method which works fine for the first time. The problem is when i again go to dashboard and again come to same page and click save button means the event is triggered twice. Is there any way to remove event if exists before firing? 

 
Hi,

I am developing an application in salesforce lightning. I have a dashboard page and after clicking any menu it will navigate to particular component. I have created the header as a separate component and included in other components. I have action buttons for the body in header component. Let's say, I have a component A which has a user form and to save the form after filling these details i have "save" button in header component. To trigger the events i used a registered event in header components like below,

    <aura:registerEvent name="renewalPriceSaveEvent" type="ESRV:RenewalPriceSaveEvent"/>

And on button click i fired the event in header controller,

        var appEvent = $A.get("e.ESRV:RenewalPriceSaveEvent"); 
        appEvent.fire();

In body component i handled that event like this,

    <aura:handler event="ESRV:RenewalPriceSaveEvent" action="{!c.onSave}"/>

And called save method which works fine for the first time. The problem is when i again go to dashboard and again come to same page and click save button means the event is triggered twice. Is there any way to remove event if exists before firing?