You need to sign in to do that
Don't have an account?
Dhaker Hassine
Two components handling the same event from the same lightning component
Hello everyone,
I declared two lightning components "calend" et "SignIn" in the same lightning component "MainComponent". And I make SignIn as the sender of an event (Type = APPLICATION) , and the two others as listeners.
With the same code in hundleaction, I've got a result with MainComponent, but Calend doesn't recieve anything. How can I resolve this problem.
Here MainComponent code :
<aura:component > <aura:attribute name="variable" type="boolean" default="False"/> <aura:handler name="connResource" event="c:LoginEvent" action="{!c.handleLoginEvent}"/> <aura:if isTrue="{!v.variable == False}"> <c:SignIn/> <aura:set attribute="else"> <c:Calend/> </aura:set> </aura:if> </aura:component>
Since you are using aura:if, might be that your Calend cmp has not been rendered on the DOM to recieve the event.
Please share your code here.
Hello Danish,
I make an attribute in Calend component, and I found a way to set its value from the parent component, like that
And it rks normally!