Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lightning-events]

Lightning Events are a way for markup component to communicate its changing state

3
votes
3answers
4k views

Callback event on $A.get('e.force:editRecord') in lightning

I'm using $A.get('e.force:editRecord') to display standard lightning edit modal window. I want to refresh my component after user saves the given record. However there are no callback events ...
7
votes
1answer
114 views

Can we use the event's attribute “path” in Lightning?

I've been working on a pretty complicated component, and I've had all kinds of trouble simply trying to identify which element is currently being used. After all sorts of experiments, I found a really ...
4
votes
2answers
11k views

How to get parent lightning component's attribute in child component?

I have a parent component name "ParentComp" which has 3 attributes A,B and C of type String. I have a nested component "ChildComponent". I want to change the value of parent component's attribute B ...
18
votes
4answers
4k views

Lightning Components: how to use events to detect record updates?

I have a custom Lightning Component sitting on a Flexipage for e.g. Account. Now I want to register an handler, which will be invoked each time, the record is updated. Updates might happen via ...
7
votes
1answer
787 views

Workaround for application event duplicates in cached lightning components (IN LOCKERSERVICE)?

This link should provide a lot of background information for my issue. Basically the problem is with Application Events, and cached lightning components. If your lightning component lives inside a ...
5
votes
1answer
5k views

Lightning component event not fired or handled

To build a nested component structure as detailed here I have build the solution described in one of the answers which recommended to send an APPLICATION event... parentInitialized.evt <aura:...
2
votes
1answer
8k views

The campingList JavaScript controller isn't setting the 'item' as a parameter or saving the record correctly

I have been through several posts on workarounds to this issue where the code works, but the challenge is not passed, none of the proposed solutions seem to work for me: https://d2hwpln2xvs3s....
11
votes
3answers
983 views

How to link Lightning Components using events inside a Lightning App Builder page?

I have a set of Lightning Components that I want to allow customers to assemble in different layouts and combinations inside the Lightning App Builder. These components interact: when a user clicks on ...
4
votes
2answers
3k views

How do you stop an application event from propagating to another instance of the same component?

I'm currently building a native dynamic data table in lightning (not using any 3rd party libraries). For some features of the table to work, I had to use application events because component events ...
8
votes
0answers
252 views

Make custom, in-memory “Lightning Data Service” work

Lightning Data Service is great. Multiple components are magically linked to database records. When records change in the db component show that change. Imagine this to work without saving change to ...
3
votes
0answers
376 views

Lightning “change” event doesn't fire in aura:Iteration

I am passing an Object to my component and iterate through it's child records. To handle changes I added the Lightning change handler. (I made data an array, so I can set a default for demo purposes, ...
3
votes
2answers
2k views

Communication between parent and child Lightning components during initialization

I'm building a component structure of the kind <c:parent> <c:child name="xyz" /> </c:parent> and I need the parent to know about its children. Why, because the parent is ...
7
votes
2answers
3k views

$A.util.removeClass happens seconds after execution

I'm changing data in a component and show a spinner as soon as changes happen. The handler executes all the lines, but $A.util.removeClass(cmp.find("loading"), 'slds-hide'); seems to be fired after ...
4
votes
1answer
2k views

How to use event navigateToComponent

Can anyone help me? Trying to do very simple function to navigate from component to another. I copied the code from Developers guide, but for some reason it doesn't work for me. My function to ...
3
votes
2answers
2k views

Lockerservice and event.getSource()

I have a few lightning components already written and those use <lightning:x /> markup. I am still not able to use event.getSource() instead of an aura:id in scenario where I do an aura:...
2
votes
1answer
2k views

How to find out when force:editRecord dialog is closed after saving changes?

I have an appHostable component that I exposed as custom lightning component tab and added to one of my lightning applicaitons (lightning nav bar). The component is trying to use force:editRecord ...
0
votes
1answer
63 views

Can I save and fire lightning event later?

I am trying to fire the same lightning event from one component more than once. Is it possible to save the event in a variable and use it to fire? I saw this question. It did not help.
10
votes
2answers
3k views

Reliable way to clear a setInterval used by a Lightning Component?

I'm using JavaScript's setInterval to run some client code every few seconds in a Lightning Component and also have clearInterval logic working to remove that timer within the component. But if user ...
9
votes
1answer
592 views

Send Lightning events only to nested components

I have a nested component structure <c:parent> <c:child /> <c:child /> </c:parent> and I want c:parent to send a COMPONENT event which is received by the c:child ...
5
votes
2answers
2k views

how to access the save button in a modal when implementing the force:lightningQuickAction

I am actually creating a component that will implement the force:lightningQuickAction so that my component open in a modal window from the action button.I would like to capture the event where the ...
5
votes
1answer
3k views

How do I get the Lightning Component “destroy” system event to fire?

I have a fairly bog standard Lightning Component with markup like: <aura:component controller="MyController" implements="flexipage:availableForAllPageTypes,force:appHostable,force:hasRecordId,...
5
votes
3answers
480 views

cmp.set() is blocking the UI to re-render, but no event is triggered

I'm having a big table filled with custom cell components and after changing a cell, the table gets re-rendered. dataChanged: function(cmp, evt, helper) { var table = cmp.get("v.data"); ...
3
votes
1answer
2k views

Firing Events from the Visualforce and Handling the Events in lightning components

If I have a visualforce page embedded in a lightning component. How can I fire a lightning event in the visualforce page and then handle it in the lightning component? In my Visualforce page i ...
5
votes
1answer
517 views

How to run code when the browser window is resized in a Lightning Component?

I am running some code on the render event that decides whether or not some buttons related to scrolling are displayed depending on some element properties: <aura:handler name="render" value="{!...
3
votes
2answers
2k views

Lightning openfiles error

I am using lightning:openFiles to popup the file in lightning but after doing research and searching similar post in Stack exchange i am still unable to find out the error. <aura:component ...
2
votes
2answers
1k views

Listening for the record create event

I have a custom component which shows all tasks on the case. Now whenever a new task gets created by log a call then I would like to refresh the developed custom component to reflect the newly created ...
2
votes
0answers
789 views

Callback on “e.force:editRecord” Lightning Event

I have a page listing Cases with an edit button assigned to each one - the edit button fires a standard e.force:editRecord event, passing the recordId per button. Is there a way I can run a function/...
1
vote
1answer
925 views

How to get parameter value from event?

I have the following codes: Event <aura:event access="global" type="COMPONENT" description="Event template" > <aura:attribute name="data" type="String"/> <aura:attribute name="sample"...
1
vote
1answer
33 views

Where are events registered with aura:registerEvent documented in the component spec?

This is a seemingly simple question that maybe someone can help me with: the <aura:registerEvent /> tag has a "description" attribute. Based on the way other tags are documented (e.g. <aura:...
0
votes
1answer
41 views

Dynamic DOM : firing event on click

I am dynamically creating some DOM elements inside my component's controller and adding them to the page. I need to set the onclick event on these elements to call another controller function that ...