You need to sign in to do that
Don't have an account?
kosh
lightning:button get value in client controller
I create a bunch of buttons in a table with aura:iteration. Think of it as one per contact per row to act on the record. Here is the button markup inside a td -
Thanks.
<lightning:button variant="brand" label="Charge" value="{!s.Id}" onclick="{!c.callMyCallback}" />Now, how do I access the value attribute for the button in my client js controller callback? event.currentTarget.value is undefined. Any ideas?
Thanks.
put name attribute in button like this value="{!s.Id}" and then use event.getSource().get("v.name"). You will get the name of button. Please mark this as correct answer if it works for you.
1. Nestor Velázquez's solution:
2. Use a wrapper class to hold the contact details and other info so an iterative list can allow selection from the list.