Questions tagged [lightning-events]

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

1
vote
1answer
397 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 ...
0
votes
1answer
511 views

Lightning Out Event Handling

I have an application which includes an Application event. There are 2 components. Component A has a form which when the button is clicked it fires and event. Component B has an aura:handler and ...
0
votes
0answers
298 views

Aura event recordSave not available after reloading the Page (Browser tab refresh)

I am using Component force:recordEdit in my lightning component cmpA to show standard Record Edit page and to handle event force:recordSaveSuccess (Successful Save). Custom component cmpA is being ...
0
votes
0answers
187 views

Unable to invoke action from ui:button component in Lightning

Could you please help in solving this issue?. I am unable to invoke controller action from ui:button press event. Code is below. Controller.js ({ displayName : function(cmp, event) { ...
5
votes
3answers
861 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 ...
2
votes
2answers
4k 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 ...
5
votes
1answer
773 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 ...
9
votes
1answer
603 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
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:...
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 ...
1
vote
1answer
295 views

How to notify highlight bar about record changes?

On my lightning record page i have a standard "Highlight Panel" component that displays some data in addition to some more components below (tab component with record detail component, etc.) When I ...
0
votes
2answers
440 views

StopPropagation for Component

For the DataTable, there is a row click select function and in one cell, there are action buttons. Comp 1: <aura:component > .. <tr class="{! 'file-list-row ' + (file.checked?'slds-...
0
votes
1answer
206 views

How to handle type-dynamic force:navigateToObjectHome in Lightning Out?

To make a Lightning component also navigate properly in Classic I am capturing events in a Lightning-Out Visualforce page and transform them for the Classic world. I didn't came up with a way to ...
1
vote
2answers
198 views

ui:inputTextArea not binding to any events

I have a lightning component that looks something like this: <ui:inputTextArea placeholder="Type a message..." rows="1" updateOn="keyup" keyup="{!c.checkKeyPress}"/> I have a console.log at ...
7
votes
3answers
10k 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 ...
0
votes
1answer
221 views

How to open lookup field record in force record view tag?

I am using force record view tag <force:recordView recordId="{!v.agreementId}"/> to view all the fields of a record. For the lookup fields related to selected record, name is clickable but ...
0
votes
1answer
113 views

Can I use html5 event listener instead of lightning change handler attribute

As I studied this documentationhttps://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_data_change.htm I understand that I need to create change handler<aura:handler name="...
2
votes
0answers
45 views

Lightning component with force:* dependency will reload endlessly

I had a component defining <aura:dependency resource="markup://force:*" type="EVENT" /> using the wildcard to not have to thinks about what to define when. But the the component forced to ...
5
votes
1answer
330 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? ...
4
votes
1answer
1k 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 ...
0
votes
1answer
441 views

Need to change Value on every value change in lightning component

HI I Want to Change Result(Servicevalibility) value as soon as there is any change in Input Fields.But,Now its changing only when i change the value and press tab key . Component - ...
0
votes
1answer
8k views

Refactor Components and Communicate with Events

[EDIT] I have made some alterations on my code and it does work, but I keep getting a error on the challenge now (so I am updating my codes with this edit) Challenge Not yet complete... here's what'...
10
votes
1answer
9k 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 ...
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
1answer
1k views

Event in Lightning, not working as expected

I have two components in which one is parent and other one is obviously child. I have a ui:inputtext in child component and on keyup event, I am handling fired event in parent component. But it is not ...
0
votes
1answer
89 views

Component event handler not invoked

I have a hierarchy of components as shown below: c:DataGridContainer |__ c:DataGrid |__ c:DataTable I have defined a component event(...
3
votes
1answer
445 views

Dynamic checkbox component in Lightning, unable to get event in controller

I am creating dynamic checkbox component in Lightning in helper class but I am not able to capture click event in controller class as value is undefined for event. Helper var checkBoxDef = []; var ...
1
vote
0answers
201 views

Lightning Component Error, - Init Event : Error during init [Cannot read property 'apply' of undefined]

I am developing a new Lightning Component with custom Event. But I am getting Following Error while loading the Page in browser Preview. Sorry to interrupt This page has an error. You might just ...
0
votes
2answers
107 views

Handling events from UI components

I was reading following document (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ui_events.htm), but there is nowhere specified how to find out, which UI component triggers ...
2
votes
0answers
114 views

Strange availability of force:navigateToSObject events in lightning component

I'm currently facing a really strange behaviour during Lightning component developement. I created a react app that runs inside a simple lightning component, which only provides the style and script ...
0
votes
3answers
1k views

Lightning:openFiles Fires but does nothing

I am trying to use some out of the box events within lightning components, but nothing seems to happen once they are fired. I have the same issue with pretty much any out-of-the-box event. Currently, ...
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,...
1
vote
0answers
44 views

Value change not directly detected [duplicate]

Say I have a component and child as below: Component <aura:attribute name="acc" type="Account"/> <aura:handler name="change" value="{!v.acc}" action="{!c.valueChanged}" /> <c:myChild ...
1
vote
1answer
463 views

Salesforce Lightning Component TypeError evt is undefined

I have a child component to upload a file and set the file related values on the event parameters and calling that event on the parent component.The event is of application type. Whenever i click on ...
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 ...
0
votes
1answer
659 views

Lightning Event with multiple components as handlers?

We have created a lookup component that we are reusing throughout our lightning app. Because these lookups are under each other, I would like to have all other the drop downs be closed as soon as one ...
1
vote
3answers
4k views

How to get Child Component value from Parent component in JS controller?

Child Component - SearchBarCmp.cmp <aura:component > <input type="text" class="form-control" onchange="{!c.searchKeyChange}" placeholder="Search" id="SearchKeyValue"/> <...
1
vote
0answers
24 views

How to remove the reoccuring events for a particular user in salesforce

How to remove the reoccuring events for 2 inactive users
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 ...
4
votes
1answer
186 views

Async call from lighning component [onInit] to [afterRenderer]

is it possible to pass some arguments from the onInit method of a Lightning component to be performed when the renderer finishes? In my case I'm loading data in the onInit and want to modify some ...
1
vote
1answer
656 views

aura:waiting fired after aura:doneWaiting

When doing development with Lightning, I've noticed that the order events are fired/handled are not deterministic (this makes perfect sense given the architecture of Lightning). Unfortunately, what I'...
7
votes
1answer
815 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 ...
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 ...
13
votes
2answers
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 ...
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
844 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 ...
2
votes
1answer
9k 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....
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:...
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 ...
6
votes
1answer
639 views

Lightning Components: is the Standard Tab component firing app events when switching tabs?

I need to know when a tab is switched. Can I subscribe to an event and get notified? In my usecase I need to commit pending changes before user switches tabs or at least notify the user. Just need an ...