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

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 ...
6
votes
1answer
5k views

Refresh parent page on close of lightning quick action modal

I have a custom lightning component which pops up when I click on a quick action in a record detail page. Once I click on a button in the popup, I want the popup to close and the parent detail page. ...
1
vote
2answers
318 views

Event is not firing both application and Component events

I just started lightning component development. When i tried to fire an event from the page its not firing. Can somebody suggest me where i missed it. Here is my code. I just like to know where i ...
3
votes
3answers
1k views

Can we reload screen after Save from force:editRecord event?

I've a Custom Lightning Component displaying a List custom object records. On each data row, I've custom button to Edit the record. On Edit click, I've fired following event: var editRecordEvent = $...
5
votes
0answers
361 views

Lightning component error handleOnBlur event

I have an iteration on a component with an ui:inputNumber inside, which has an onchange event that calls a server side action. If after i change the value, i click on an input after the onchange is ...
1
vote
0answers
264 views

Lightning and browser back/forward navigation not reloading page

When going back in the browser from one lightning page to another, I have a situation where data that was modified in a subsequent page is now stale on the previous one and the user has to refresh to ...
1
vote
1answer
216 views

can parent handle Childs event fired by child during init?

I have a child component <aura:component controller="campingController"> <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> <aura:registerEvent name="add" type="...
2
votes
1answer
2k views

How to add listener for toast notifications?

I want to perform an action when a notification happens in my app. The toast event is raised by SFDC which means I do not have access to the calling code. I have tried adding a handler to the force:...
0
votes
1answer
57 views

How to seperate info fired from multiple instances of same component in a parent component?

Can we dynamically add a component multiple times and still retrieve information fired by these similar components uniquely in the parent component? I need to create a filter that shows fields, ...
2
votes
1answer
208 views

CometD / Streaming API: Firing an event inside of PushTopic's action throws a TypeError exception in Lightning Component

Let's consider a Lightning component with a single button and which uses a CometD / Streaming API to handle some server actions. A button click calls a server-side controller's action which inserts a ...
2
votes
0answers
174 views

Input too long when firing a custom event

What I'm trying to do is, onblur of the amount field, the total amount event would fire and would update the parent component's total amount attribute. Im doing this so that the running total in the ...
6
votes
2answers
218 views

Distinguishing a change event when there are multiple instances of a child component

I'm building a form in Lightning where I want to use the Appiphony Strike lookup component to get input for lookup fields. I also have my own component that depends on the value selected for the ...
2
votes
3answers
145 views

Do out-of-the-box events no longer work in Lightning Components?

I'm testing lightning components and created a test app using out of the box events and none of them do anything. Here is my code for the client controller: ({ goToRecord : function(component, ...
1
vote
1answer
297 views

Lightning: Detecting attribute changes after initial value

My problem is related with the 'change' event on a component attribute. I only want to execute a code after this attribute is initialized by the parent component. For example: <!-- CHILD ...
0
votes
1answer
1k views

Application Event is not getting handled in the component

I made sure I understand how the application event should be fired and handled and how the syntax is different from component Event. I executed the example at - https://ck-developer-salesforce-com....
2
votes
2answers
216 views

Check events emited by lightning component from managed package

I have to cal some action in my lightning component when the child component finished rendering. Best practice AFAIK is to handle event thrown by child component, but the problem is that I dont have ...
11
votes
3answers
1k 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 ...
0
votes
1answer
43 views

Is it possible for the server to send messages to Lightning Components?

Let's say I have a component c:Widget which is being displayed in some user's browser. c:Widget displays the contents a Widget__c record. Let's say something causes the Widget__c record to update on ...
5
votes
1answer
530 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="{!...
8
votes
0answers
257 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 ...
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 ...
1
vote
1answer
370 views

Problem while getting application lightning event in salesforce lightning component

I am not able to get the reference to an application level Lightning Event inside an Lightning component. I have defined an application level event named 'MemberEvent' and I have registered it in ...
0
votes
1answer
263 views

OpenCTI: Throw a Lightning event from Visualforce up to Lightning Experience?

We're working with an OpenCTI adapter that the vendor has open-sourced for us. So we have the ability to customize the dialer page which is by design written in Visualforce. The dialer appears in the ...
0
votes
1answer
466 views

Application event is undefined

I don't know what wrong happens is with my Application. Wherever I have written the javascript code to get Application event, it always returns undefined. And my code is just simple as written below. ...
0
votes
3answers
2k views

How to refresh the browser page in a lightning component?

I have a lightning component which handles a event and performs subsequent dml operations. Once this is done, a toast message is displayed (success/ error etc.) I want to refresh the entire browser ...
2
votes
0answers
250 views

dependent picklist not getting populated while creating a record using force:createRecord Lightning

I am trying to open a record create page on click of a button on the Account detail page in lightning. I have created a lightning component and a controller as follows. The dependent picklist isn't ...
2
votes
0answers
426 views

aura:valueChange event gives a proxy object with Map attributes

I'm working on my first non-trivial aura component for a lightning experience app, and I was trying to organize sub-component data using map attributes of essentially this pattern: <aura:component&...
1
vote
0answers
37 views

Can event.source() be stored as attribute in dynamically created component without destroying source when dynamic component is reloaded

Use Case I have a parent container that has a single reusable modal component. There is also a container with many rows of line items rendered as individual components. In certain circumstances a ...
2
votes
1answer
427 views

How to restrict 'Paste' action in lightning component

We are trying to implement Re-Confirm email id functionality, to capture email address twice on the form. For this on the second email address field we want to restrict paste action by user. We are ...
1
vote
1answer
302 views

lightning:openFiles in classic

I've my list of files in a Lightning component, and I'm using - lightning:openFiles (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_lightning_openFiles.htm) to view the ...
2
votes
0answers
262 views

Tabbing through a Lightning:tabset using tab button on keyboard?

I have a set of 6-8 tabs which show up through the lightning tabset component, and I would like to be able to go through each of these tabs using the specific 'Tab' key, instead of left and right. ...
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 ...
2
votes
1answer
824 views

How to handle an event in a child component that is fired from a dynamically created grandchild component?

I have a component that includes a child component. The child component has a button that fires showCustomModal on an overlayLibrary and the content is a dynamically created component. Component ...
5
votes
3answers
490 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"); ...
0
votes
1answer
91 views

Event Conflicts with DOM Style attributes

I have a parent component and one child component. Child component is a table which does calculation and the calculated value is sent to parent component through event. On each time calculate function ...
2
votes
1answer
961 views

How to get before/after information from change events [duplicate]

I'm changing a field in my lightning component and handle the change with a default lightning change handler. I can not make use of aura:handler name="change" since I'm in a loop, where change events ...
2
votes
1answer
6k views

Trailhead error: The campingList component isn't defining a handler correctly to listen for the addItemEvent event

Below is the error I got when I try to complete the trailhead challenge. I have tested it works, but not sure why trailhead will prompt such error. Challenge Not yet complete... here's what's wrong:...
2
votes
1answer
511 views

How to pass data to lightning controllers with change events?

I need more information about the context after triggering a change event. I decided to use data- attributes (that can only be applied to regular html tags). Since I'm using <ui:inputNumber, I can'...
1
vote
1answer
254 views

Lightning event.getSource() is returning different data structures for same input types in 2 almost identical components. Why is that the case?

Component 1 HTML: <ui:inputText aura:id="Contact.LastName" value="{!v.contact.LastName}" change="{!c.handleInputChange}"/> Controller: handleInputChange: function(component, event, helper) { ...
3
votes
0answers
395 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, ...
2
votes
1answer
2k views

Application Event in Lightning

I'm new to lightning and this is the first time I'm trying to write a event other than in trailheads. I have two components, one of them is a dynamic picklist and the other component shows a welcome ...
0
votes
1answer
495 views

Catch the event about the savedrecord in Lightning Component

I have this sample use case: Component Child - Component Component Child - Controller JS Component Parent - Component When I click the button I see the Standard Edit Modal and I can edit the ...
1
vote
1answer
379 views

Whats wrong in this lightning code it shows error : “Can not read property of value undeifined”

I am new to lightning, I will be really thankful if someone can help me for this code. Purpose : want to show employee list and a search bar above it. Error : on writing anything in the search bar ...
2
votes
0answers
304 views

Refreshing standard lightning components

I have overridden the detail page of case layout and added standard activity component. I have another custom component which is creating tasks. Problem I am facing is that whenever custom component ...
0
votes
1answer
655 views

Handle event in different instances of the same component

I have a main component that creates different instances of a child component which all have inputs and checkboxes. What I want is that whenever I change the value in a picklist for a child component, ...
2
votes
0answers
809 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/...
0
votes
1answer
47 views

Lightning Events

Good day! Today I was tasked to do a simple "app/function" that will increment an integer from parent using a button from a child component. I understood how the code works but something just bothers ...
2
votes
2answers
3k views

event target is empty

I want to get index variable of products array record in controller on which user clicked. I am trying to get this by event.target.dataset.index. But event.target.dataset.index gives undefined. The ...
2
votes
1answer
629 views

How to use multiple instances of a lightning component while handling events independently?

I have a generic card lightning component which displays some data according to the attributes provided. I have created the following hierarchy. <compA> <myComp/> <compB> &...
1
vote
1answer
391 views

Component events: list of sObjects

I have defined a component event like below to carry list of Brokers. <aura:event type="COMPONENT"> <aura:attribute name="data" type="Broker__c[]"/> </aura:event> From the ...