About

Edit photo

Thursday, November 9, 2017

Retrieving lightning component tips


How to get Lightning Button label? <lightning:button label="Get Label" onclick="{!c.getLabel}" aura:id="button1" /> <aura:attribute name="buttonLabel" aura:id="btn1" type="String"/> var BtnLabelWay1 = event.getSource().get("v.label"); -- Used when any Action event occurs, ex: onClick var BtnLabelWay2 = component.find("button1").get("v.label"); -- Can use when auraID exist...

Wednesday, November 8, 2017

How to get Salesforce Lightning event label to controller?


The below code is a sample component, is having one attribute for message, and has 2 lightning buttons. Wants to display the button label on Lighting component. <aura:component> <aura:attribute name="message" type="String"/> <p>Message of the...