No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Finding Components by ID
Retrieve a component by its ID in JavaScript code. For example, you can add a local ID of button1 to the ui:button component.
1swfobject.registerObject("clippy.codeblock-0", "9");<ui:button aura:id="button1" label="button1"/>
2You can find the component by calling cmp.find("button1"), where cmp is a reference to the component containing the button. The find() function has one parameter, which is the local ID of a component within the markup.
You can also retrieve a component by its global ID, which is an ID generated during runtime.
For example, the ui:button component renders as an
HTML button element with this
markup.
Retrieve the component by using $A.getCmp("30:463;a").
1swfobject.registerObject("clippy.codeblock-1", "9");var comp = $A.getCmp(globalId);1<button class="default uiButton" data-aura-rendered-by="30:463;a">...</button>