Activity Forums Salesforce® Discussions Where we use application custom event in Salesforce?

  • Aman

    Member
    July 12, 2017 at 12:16 pm

    Hello Shubham,

    Application Events:

    Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.

     

    Component Events:

    A component event is fired from an instance of a component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event.

  • Parul

    Member
    September 17, 2018 at 6:49 am

    Custom application event using the <aura:event> tag in a .evt resource.Events can contain attributes that can be set before the event is fired and read when the event is handled. Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component.

     

    Thanks

  • shariq

    Member
    September 17, 2018 at 11:15 am

    Hi,

    Event :

    An event can be something the browser does, or something a user does.

    Lightning framework uses event driven programming. Handlers are written for interface events and they handles the events as they fire. In Lightning framework events are triggered from client side JavaScript controller actions. The attributes in an event could be set before the event gets trigerred and read only when the event is handled.

    In Lightning framework events are declared by the aura:event tag in a .evt resource. Events can be of two types :

    Component Events:

    A component event can be triggered from an instance of a component and can be handled by the component that triggered it or by any other component in the hierarchy that recieve the event.
    Application Events:

    An application event is fired by an instance of a component and all the components that provide handler for the event are notified.
    Steps to communicate between two lightning components using events:
    Create an event.
    Create two lightning component : Child component and parent component.
    Register the event in child component and fired the event in child component JavaScript controller action.
    Handle the event in parent component.

    Hope this helps!

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos