You need to sign in to do that
Don't have an account?

Aura:method calls apex method
Hi all,
I have 3 components. Parent, Child and Grandchild.
There's a aura:method on the Child component which invokes an action of the Grandchil.Controller
The Grandchild.Controller's action calls an apex method.
What's the best way to call the Granchild.Controller's action from the Parent component?
Thanks in advance.
I have 3 components. Parent, Child and Grandchild.
There's a aura:method on the Child component which invokes an action of the Grandchil.Controller
The Grandchild.Controller's action calls an apex method.
What's the best way to call the Granchild.Controller's action from the Parent component?
Thanks in advance.
This is very interesting requirement.
I think you can call grand child's controller using nested aura:method. Something like below approach:
Parent.cmp
ParentController.js Child.cmp ChildController.js GrandChild.cmp GrandChildController.js Not sure if it's a best approach. If you get any best approach, please post here so that it will help others as well.
Thanks,
Dhanya
All Answers
This is very interesting requirement.
I think you can call grand child's controller using nested aura:method. Something like below approach:
Parent.cmp
ParentController.js Child.cmp ChildController.js GrandChild.cmp GrandChildController.js Not sure if it's a best approach. If you get any best approach, please post here so that it will help others as well.
Thanks,
Dhanya
Thanks for your efforts. This works, however I have an apex method call in the grandchild's controller.
What I've observed so far is the fact that the aura:method finishes before the apex method returns the response value.
I believe this is related to Asynchronous/Synchronous calls.
Regards,
Angel