+ Start a Discussion
Ami PandaAmi Panda 

how to convert button to hotlink in lightning component?

<lightning:button class="slds-button" variant="base" value="{!usr.UserId}" label="{!usr.Username}" onclick="{!c.openuserqueue}" />
Best Answer chosen by Ami Panda
sfdcMonkey.comsfdcMonkey.com
okay so there is no direct way to convert lightning button to hyperkink : 

but i have a workaround for it, replace your button with following code  : 
<a href="#"><ui:outputText click="{!c.openuserqueue}" value="{!usr.Username}" class="{!usr.UserId}"/></a>

in javaScript 
 
({
	openuserqueue : function(component, event, helper) {
	var UserId = event.getSource().get("v.class");
        alert(UserId);
	}
})

Thank, let me know if it helps  

 

All Answers

Ami PandaAmi Panda
Hi Piyush,
            My requirement is like, now i have this lightning button and onclick of this it redirects to another page where is show the list of queues assigned to a selected user but i want to convert this button to a hotlink ( an underlined user's name that acts like a link) and onclick of that link it should show the same functionality as the button is doing.
thanks ,
Amrita
sfdcMonkey.comsfdcMonkey.com
okay so there is no direct way to convert lightning button to hyperkink : 

but i have a workaround for it, replace your button with following code  : 
<a href="#"><ui:outputText click="{!c.openuserqueue}" value="{!usr.Username}" class="{!usr.UserId}"/></a>

in javaScript 
 
({
	openuserqueue : function(component, event, helper) {
	var UserId = event.getSource().get("v.class");
        alert(UserId);
	}
})

Thank, let me know if it helps  

 
This was selected as the best answer
Ami PandaAmi Panda
thanks Piyush.. it worked...