Quantcast
Channel: How to change UI Button label in controller? - Salesforce Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Igor Santana for How to change UI Button label in controller?

$
0
0

You can create an attribute and put it in the button's label. This way, you can simply modify the attribute's value in the js, and it will change in the button as well.

Component:

<aura:attribute name="buttonLabel" type="String" default="Get password" />
<ui:button aura:id = "Btn1" label="{!v.buttonLabel}" class="slds-button slds-button_brand" press="{!c.handleClick}" />

Controller.js

component.set("v.buttonLabel", "New label");

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>