Newer Version Available

This content describes an older version of this product. View Latest

Using the Action Type

An Aura.Action is a reference to an action in the framework. You can pass an Aura.Action around so the receiving component can execute the action in its client-side controller.

Use $A.enqueueAction() to add client-side or server-side controller actions to the queue of actions to be executed.

This sample uses Aura.Action.

listRow.cmp

The onclick attribute has type="Aura.Action".

subListRow.cmp

The subListRow component extends the listRow component and sets the value for the onclick attribute in listRow to {!c.openRecord}, which is a reference to an action in the client-side controller for subListRow.cmp. The action is executed when a user clicks the bullet associated with <li onclick="{!v.onclick}"> in listRow.