Newer Version Available

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

Which Button Was Pressed?

To find out which button was pressed in a component containing multiple buttons, use Component.getLocalId().

Let’s look at a component that contains multiple buttons. Each button has a unique local ID, set by an aura:id attribute.

Use event.getSource() in the client-side controller to get the button component that was clicked. Call getLocalId() to get the aura:id of the clicked button.