Questions tagged [lightning-button]

A lightning:button component represents a button element that executes an action in a controller. Clicking the button triggers the client-side controller method set for onclick. Buttons can be either a label only, label and icon, body only, or body and icon.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

I have a Search Order Lightning Component that has a button that will open again the Lightning Component in a new subtab

I have a Search Order Lightning Component that has a button that will open again the Lightning Component in a new subtab but upon opening the component I want to fetch the values and still display the ...
1
vote
1answer
29 views

How to align button to right and vertical center inside a division?

I want to display a text and two buttons inside a <div> in a <aura:component>. When I use the following code: <div style="background-color:blue; margin:2px; padding:10px;" > <...
0
votes
1answer
46 views

How to toggle cursor pointer on lightning button

I'm having a lightning button called "Submit". I have added css property to that button to display it in red color. When I click on that button, I want to change my cursor pointer style to 'not-...
0
votes
1answer
28 views

Button icon with possibility of passing parameters and get element

I have a IconButton , but to pass parameters to the JS, I use regular Icon with span like this : <span onclick="{!c.copyLink}" data-theurl="{!item.path}" data-caseid="{!item.id}" > <...
0
votes
1answer
56 views

Remove highlight from current tab when button is clicked again, I am using setTabHighlighted() to highlight current tab

I have created aura component to highlight tab onclick of button and it is working as expected. But I want to remove that highlight from tab when button is clicked again, not sure how to do this. ...
0
votes
0answers
26 views

How to force click from Lightning Button

I would like to force the click of a lightning button that is inside an aura: iteration. I'm using the class variable, which in the code below looks like "data.idMedico". <table id="tabelaBusca" ...
1
vote
1answer
882 views

Dynamically set the onclick function in LWC button

I'm trying to dynamically set the onclick function of lightning web component button but it's not working. I've tried both "click" and "onclick" JS: const navButton = this.template.querySelector('....
2
votes
2answers
2k views

How to make buttons in a lightning-datatable smaller in LWC?

I have a lightning-datatable in my Lightning Web Component (LWC) that has several buttons in each row (first button only shown here): These standard-sized buttons consume quite a lot of vertical ...
0
votes
1answer
292 views

LWC - Why is the computed rowId for my custom data type in lighting-datatable undefined?

I have a custom lighting-datatable where the last row is a column that contains two buttons. When either of these buttons is pressed, I am attempting to retrieve the rowId of the row where the button ...
6
votes
1answer
286 views

LWC - How to communicate property changes down the hierarchy

By following a tutorial (How to use custom LWC lightning component in lightning-datatable) I was able to extend lightning datatable and insert a button into the final column. Now, I am currently ...
0
votes
2answers
466 views

How to open buttons of datatable in a new tab?

I am using a datatable to show record details. It has a view button that will take the user to the respective record. I want to open record in a new tab. Right-clicking a button does not show the open ...
0
votes
1answer
961 views

How do you get ID of lightning button inside of an iteration?

So I get the error "component.find.(...).get is not a function". Through research I found out that this is because iteration creates multiple instances of aura:id. I've tried to use event.getSource() ...
-1
votes
1answer
112 views

Callback method isn't executing

My callback method isn't executing when trying to run multiple helper functions in a single controller method. -----------------------------------------------------------------Solved-----------------...
1
vote
0answers
82 views

How do I open a Visualforce PDF page from a Lightning component button?

I have a lightning component (called from a quick action), on which a few inputs are taken. On clicking of a button I need to show a Visualforce PDF page. Can I do so directly from the button or do I ...
1
vote
1answer
2k views

Recreating lightning-button with custom color

I am trying to replicate lightning-button in my Web Component because I need to use custom colors, and supposedly you can't override the lightning-button with css to change these colors... So here is ...
2
votes
2answers
5k views

Changing colors of lightning-button

How can I change the colors of lightning-button? I tried doing this in my css: .my-button { background-color: #14a6bc; color: #ffffff; } and applying that class to my <lightning-button&...
0
votes
1answer
503 views

Add validation to managed lightning button

I have a managed (detail page button, content source: visualforce page) button which when clicked opens a visualforce page, I want to make this button shows a message if a field on the object is ...
1
vote
0answers
1k views

Lightning button attribute “Disabled” in “aura:iteration tag”

I'm trying to enable a lightning:button if a lightning:inputField changes. This is the aura:component: <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:...
0
votes
1answer
2k views

lightning:button inline edit, only show icon

I have a lightning component in which I have built a data table. In this data table I have a component for each row. Everything works fine except one cosmetic thing. The inline edit button shows an ...
2
votes
1answer
247 views

Download Screenshot in PDF on button click in lightning component

I have a lightning component which displays list of accounts in table. And I need to create a button. On clicking , screenshot of the screen should be downloaded as PDF/excel file. I am not sure how ...
1
vote
2answers
6k views

Make a lightning button constant in size

I have a lightning button in my custom component. Not the button size is dynamically changing depending on the button text Is there any way to make it constant?
1
vote
1answer
262 views

We need to uniquely identify multiple lightning components on same page( using lightning app builder)

We need to uniquely identify multiple lightning components on same page(added using lightning app builder) and we need to save respected responses and use them later. For this purpose we need a unique ...
0
votes
0answers
85 views

Button text coming in two lines and increasing the length of lightning button

i have a lightning component button which has a longer text and it is going in two seperate lines and forming the following structure. Is there any way to keep it in a single line? i used the ...
0
votes
1answer
2k views

Hover Text on lightning button in custom lightning component

I have a lightning component button in a custom lightning component. I want a hover text to appear on the button. Is this possible in lightning?
0
votes
1answer
700 views

event.getSource is not a function

When trying to get a button's value on lightning component controller, I'm getting the following error: event.getSource is not a function This is the code on the component side: <lightning:...
0
votes
2answers
522 views

Disable Button depending on the comparison between an attribute and list size in a Lightning component

My code is the next one: <aura:attribute name="listAddress" type="List" /> <aura:attribute name="rowValue" type="Integer"/> <button class="slds-button slds-button--neutral slds-grow" ...
1
vote
1answer
1k views

Enable lightning button on value entered

I have two lightning:button and a lightning:input field. What I have seen in some places is that. Some buttons are enabled only when values are entered in the text boxes. Is this achievable in ...
3
votes
1answer
11k views

Create Custom Button in Lightning that calls an Apex Class Method [closed]

I am new to Lightning and I would like to create a Custom Button (or maybe an Action) that just calls a Method in an Apex Class (in which I am sending some parameters). Is this posible to do? ...
2
votes
1answer
5k views

Lightning button Variant - To appear blue/white and appear center aligned

Trying to build a form and I put 2 buttons in the form. Want 1 of the button as to appear blue and other to appear white. I created below component: Searchform.cmp <aura:component > <!--...
1
vote
2answers
7k views

How do I make a lightning:button expand horizontally to fill a div?

Is there any way to make a lightning:button expand horizontally until it fills the boundaries of its div? I've been trying for ages but nothing I try works, is it possible or is salesforce still ...
1
vote
0answers
736 views

Updating a field on record detail page with Lightning button [duplicate]

I am stuck with issue in Lightning. I want to do a field update on record page on click of a button, and will be showing a message to user on successfully updation of that field. Lets say, I am ...