• #65926
    Salesforce | Nikita Nikita #2
    Forcetalks

    When we should use aura:handler in lightning component ?

    When we should use aura:handler in lightninn component ?

    #65932
    Salesforce | Piyush Piyush #1
    Forcetalks

    Hi,

    In lightning component <aura:handler… > is used for handle standard and custom events
    we can create our custom lightning event and also use standard events, standard lightning event is automatically fired when related event is fire
    standard event like -:
    1. aura:valueInit – : Indicates that an app or component has been initialized.
    This event is automatically fired when an app or component is initialized, prior to rendering. The aura:valueInit event is handled by a client-side controller. A component can have only one <aura:handler name=”init”> tag to handle this event.

    Ex:-
    <aura:handler name=”init” value=”{!this}” action=”{!c.doInit}”/>

    2.aura:waiting -: Indicates that the app or component is waiting for a response to a server request. This event is fired before aura:doneWaiting.
    This event is automatically fired when a server-side action is added using $A.enqueueAction() and subsequently run, or when it’s expecting a response from an Apex controller. The aura:waiting event is handled by a client-side controller. A component can have only one <aura:handler event=”aura:waiting”> tag to handle this event.

    Ex:-
    <aura:handler event=”aura:waiting” action=”{!c.showSpinner}”/>

    3. aura:doneWaiting – : Indicates that the app or component is done waiting for a response to a server request. This event is preceded by an aura:waiting event. This event is fired after aura:waiting.
    This event is automatically fired if no more response from the server is expected. The aura:doneWaiting event is handled by a client-side controller. A component can have only one <aura:handler event=”aura:doneWaiting”> tag to handle this event.
    Ex:-
    <aura:handler event=”aura:doneWaiting” action=”{!c.hideSpinner}”/>

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

Popular Salesforce Blogs

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?