I want to call the init method of a child LC from a parent LC.
I tried to use aura:method, and call the init method from a parent method.
.....
<aura:attribute name="userContact" type="Contact" />
<aura:method name="callInit" action="{!c.init}" >
<aura:registerEvent name="appEvent" type="c:ET_AppEvent_OverNightStay"/>
<aura:handler name="init" value="{! this }" action="{! c.init }"/>
<lightning:layout multipleRows="false" >
<lightning:layoutItem size="10">
</lightning:layoutItem>
........
But it seems, that if I use (aura:method) I can't use (aura:registerEvent) and (lightning:layout) and many other tags!!
So my Qeustion: How can I achieve this?
Just to clearify my problem, I have a parent component, and in this parent LC I have several Child LCs. It's like a path that user has to take. this path is the following, when a user click on (event reservation) he has to fill the following (Select Contacts --> Select Events to attend --> Select Hotel and Room --> Summary&Confirm --> Confirmation Message) There is a big parent then (book) parent then the 5 childs.
In General I'm using the (Lightning Inter-Component Communication Patterns) - To send data from parent to child --> Attributes - To send data from child to event --> Events
So when ever I'm switching to the next step (LC) the init method will be fired (but only once!). So when I'm on the second step and select an event, then click next and fill the data of the hotel third step. If I click back to second step, and changed something and clicked next, the data from the second step, will not be noticed, since the init will not be fired again.
aura:registerEvent
etc if you useaura:method
. Youraura:method
looks to have missing a closing tag</aura:method>
, which may be the issue why the subsequent elements are not working correctly.