Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [lightning-events]

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

Filter by
Sorted by
Tagged with
17 votes
4 answers
2k views

Why EXACTLY not calling Aura.Action attribute from Lightning Controller using $A.enqueueAction()?

Since the event registration/subscription feels like a long roundtrip for simple things, I found a "hack" for implementing a simple onchange handler in my own Lightning Components in form of an Aura....
Uwe Heim's user avatar
  • 28.4k
17 votes
4 answers
10k 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 ...
Uwe Heim's user avatar
  • 28.4k
14 votes
3 answers
32k views

NoErrorObjectAvailable Script error

I have a LWC that is used in different orgs. In one of them, when I dispatch an event like: this.dispatchEvent( new CustomEvent( 'press' )); I am getting the [NoErrorObjectAvailable] Script error in ...
Gabriel Serrano Salas's user avatar
12 votes
3 answers
2k 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 ...
Keith C's user avatar
  • 136k
12 votes
2 answers
12k 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 ...
Keith C's user avatar
  • 136k
11 votes
2 answers
41k views

LWC : Events - When to use event.target.value & event.detail.value [closed]

I am looking for the difference between event.target.value and event.detail.value. It was mention that To communicate data to elements in the same shadow tree, use event.target and To communicate ...
Naman Jain's user avatar
11 votes
1 answer
21k views

lightning:spinner solution that finally works (using custom events, not aura:waiting)

Lightning components without a working loading indicator are just not professional. Too bad that there is not code example out there that seems to work under real-world circumstances.Every blog out ...
Robert Sösemann's user avatar
10 votes
2 answers
2k views

Lightning Events: why force:refreshView is fired 4 times when a record is updated via standard Record Detail on Flexipage?

I need to detect record-updates by different sources as stated here: Lightning Components: how to use events to detect record updates? For this example, I'm using the standard Record Detail compo on ...
Uwe Heim's user avatar
  • 28.4k
10 votes
0 answers
380 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 ...
Robert Sösemann's user avatar
9 votes
1 answer
996 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 ...
Robert Sösemann's user avatar
9 votes
1 answer
10k views

Lightning Web Component use Publish-Subscribe event in Community cloud

How can we use publish-subscriber event pattern in Community Cloud using lightining web component. I have drag-and-drop two Lightining Web Component(LWC) in a community page. On click on first ...
Varun Rajpoot's user avatar
8 votes
2 answers
6k 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 ...
itsmebasti's user avatar
  • 6,457
8 votes
1 answer
2k 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 ...
Jason Lee's user avatar
  • 1,547
7 votes
1 answer
17k 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 ...
Rimii's user avatar
  • 75
7 votes
1 answer
4k views

How to setup eventListener for a LWC component to receive messages from an embedded iFrame

I am having trouble setting up an eventListener for my LWC component to listen messages received from an embedded iFrame. I have a parent component where I have set the event listener in ...
NoCanDo's user avatar
  • 311
7 votes
2 answers
7k views

Lightning:recordForm cancel button unresponsive

I'm building out some community features and one of them is like a related list with a new button. When the user presses the new button, I am launching a modal window with another custom component ...
textual's user avatar
  • 311
7 votes
3 answers
8k views

Reload after "e.force:editRecord"?

I have a Lightning Component that displays a lightning:dataTable of custom object records. Displayed fields include Name, Amount, and Date. I need the fields to be editable, but dataTable's inline ...
PatMcClellan__c's user avatar
7 votes
3 answers
19k views

Lightning RefreshView event not working on record detail page

I found that the RefreshView event doesn't always reload record data. I'm writing a Lightning Component that updates a record, then tries to reload the record details to show the changes, but ...
ctrl-z's user avatar
  • 397
7 votes
1 answer
18k views

refresh child components from parent LWC

I have 3 components as child, parent and grandparent. From child component, I dispatch an event using bubbles: true, composed: true, intimating the grandparent to refresh. In the grandparent, I use ...
sfdcnoob's user avatar
  • 632
7 votes
1 answer
756 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 ...
sfdcfox's user avatar
  • 494k
7 votes
1 answer
2k 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="{!...
Keith C's user avatar
  • 136k
6 votes
1 answer
9k 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:...
Robert Sösemann's user avatar
6 votes
1 answer
6k 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,...
goofballLogic's user avatar
6 votes
2 answers
684 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 ...
David Cheng's user avatar
  • 7,092
6 votes
0 answers
659 views

Neither forceCommunity:routeChange or aura:locationChange cannot detect the URL change with history.replaceState

We have a use case where a lightning component built in LWC, should trigger a URL change. We're handling that with the history.replaceState method(note that we encountered the same problem with ...
Endrit Sino's user avatar
5 votes
2 answers
20k 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 ...
Pranay Jaiswal's user avatar
5 votes
2 answers
5k 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 ...
user3562811's user avatar
5 votes
1 answer
2k views

Are lightning event synchronous or asynchronous?

Are lightning event synchronous or asynchronous? component1: <aura:component> <aura:handler name="event1" event="zced:TypeDoesNotMatter" action="{!c.event1Function}"/&...
hellohowdoyoudo's user avatar
5 votes
3 answers
7k views

Lightning Web Components: How to handle events from grand child on the owner(eventParent) component

I have 3 Lightning web components, Parent ->Child -> Grand child all with just a lightning button inside it. eventParent: <template> <lightning-button variant="brand" label="Submitparent" ...
RedDevil's user avatar
  • 7,821
5 votes
3 answers
8k 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 ...
Soham's user avatar
  • 333
5 votes
3 answers
14k views

How do I get the Value of a ui:inputCheckBox Lightning Component?

I am currently stuck on an issue I am having getting the value of the ui:inputCheckbox Lightning component. In the Lightning Component Developer Guide, the following example is provided: COMPONENT ...
Daniel Fuller's user avatar
5 votes
1 answer
960 views

Application Event fired by a child component doesn't flow down other child component

I have 1 main component (Parent.cmp) which includes 2 components (Brother1.cmp and Brother2.cmp). Brother1 fires an event which should cause an action in Brother2. Documentation says that we should ...
fredbe's user avatar
  • 135
5 votes
1 answer
8k views

LWC – Access Templates and Methods of child components (multi-chained children)

Normally closed shadow DOM/root will not allow the access of child component's DOM. Consider below example: <main-component> <parent> <child> <iteration&...
salesforce-sas's user avatar
5 votes
3 answers
881 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"); ...
itsmebasti's user avatar
  • 6,457
5 votes
3 answers
2k views

Find changed variable/field name in aura:valueChange event

When using <aura:handler name="change" value="{!v.state}" action="{!c.changed}"/> I can see field go from old value to new one (event.getParam('oldValue')), but I cannot see which field it ...
dzh's user avatar
  • 4,145
5 votes
2 answers
4k views

force:recordData "recordUpdated": Detect Trigger/Workflow Changes

I'm using Lightning Data Service in a component. It all works well. One item I've noted is that it does not seem to detect changes to fields which may have occurred via a trigger or workflow after a ...
RedQueries's user avatar
5 votes
1 answer
1k views

Is there an event to handle Successful creation of record when event force:createRecord is used

I am creating custom object records using standard salesforce record creation feature by firing the event force:createRecord from my custom component. After saving the record, Page navigates to ...
Sriram's user avatar
  • 701
5 votes
1 answer
617 views

Which force:* events must I declare as <aura:dependency>

I'm confused when to use <aura:dependency resource="force.."> and when not? If my component is using on of the following system events does it need to be explicitly declared as dependency? ...
Robert Sösemann's user avatar
5 votes
2 answers
5k 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 ...
vanessen's user avatar
  • 2,685
5 votes
2 answers
2k views

Dynamically Adding Event Handler within CreateComponents

UPDATE: Resolved by updating the Lightning Component Bundles being created to API version 43.0 ALSO: For future reference, the 8th line of the second code block (var el = els[i];) should instead be ...
iwhitt567's user avatar
  • 440
5 votes
0 answers
149 views

How can I manage lightning components' navigation-related caching

This is related to this question: Navigation in Desktop Lightning Experience not Destroying Components My components are listening to the force:refreshView event, but since the components are cached ...
Valyrion's user avatar
  • 1,144
5 votes
5 answers
12k views

Cannot read property 'config' of undefined

I get this error just randomly: Uncaught Error in $A.getCallback() [Cannot read property 'config' of undefined] Callback failed: apex://taskKanbanController/ACTION$getKanbanWrap Here's the relevant ...
Sairisheek Muttukuru's user avatar
5 votes
0 answers
768 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 ...
user37586's user avatar
  • 660
4 votes
2 answers
14k 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 ...
Jigar Trivedi's user avatar
4 votes
1 answer
494 views

Is there any meaningful difference between event.getParam("x") and event.getParams().x?

Why does getParam() exist if there is already getParams()? Is it only for personal preference? Should I pick one in certain situations and the other in other situations? E.g. if event.getParams().type ...
Bloke's user avatar
  • 217
4 votes
2 answers
7k views

Can a parent component set the attributes of a child component

I have a parent and a child component that can be nested like this <c:parent> <c:child attribute="" /> <c:child attribute="" /> </c:parent> During the init of the ...
Robert Sösemann's user avatar
4 votes
1 answer
8k views

How to check the CustomEvent detail in a Jest test for an LWC?

I'm on my first day of writing Jest tests for one of our LWCs, and that component fires an event with some dates included as the event detail: @api get selectedDates() { return this....
Keith C's user avatar
  • 136k
4 votes
1 answer
2k views

Event handler not invoked when event is fired

I am having trouble raising event from one component and capturing it in another component. Here is what i am trying to do. I have button on my home page. Clicking the button opens the first modal ...
Rohitha's user avatar
  • 85
4 votes
1 answer
5k 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 ...
G Takei's user avatar
  • 193
4 votes
1 answer
2k views

Lightning Events: how to get the name of an Application event in the handler

I want to have one method for ALL events. In that method, I need to dispatch the event-name and whatever detail I can get about the event. The way I'm trying it, all seems to be empty (s. Result). Is ...
Uwe Heim's user avatar
  • 28.4k

1
2 3 4 5
7