Questions tagged [lightning-events]
Lightning Events are a way for markup component to communicate its changing state
312
questions
1
vote
1
answer
125
views
pass Id in onclick to js controller
I'm trying to write my own version of pills in LWC without using the base component. I want to be able to pass the item.Id once a pill is clicked, but I always get undefined.
HTML:
<template ...
0
votes
0
answers
64
views
Handle LWC event in Visual force page
I have overridden Standard "convert Lead" button with a Visual force page. LWC component is inside Visual force page using Lightning out. When I click Cancel button in LWC component, I want ...
2
votes
2
answers
278
views
Adding LWC in Record Page Layout Section
Aside from nesting inside a visualforce, is there any way to add a LWC between sections in a page layout? Please take in consideration these Components will call events like getRecord, ...
1
vote
0
answers
18
views
Is there an event created when the arrow buttons are clicked on a OOB Flow Screen Component?
In the below screenshot, is there an event created when the arrow buttons(in Red box) are clicked? We would like to customize service resource availability so we need to know if next week or previous ...
0
votes
1
answer
52
views
How to set recurring events IsReminder date and time using Apex
I am trying to create a recurring event which is a full day event and event will create every week and I want to set a reminder before 15 min of the event starts.
Below are the lines which I am using.
...
0
votes
0
answers
55
views
On click button how to refresh the specific Child Lightning component
I have parent component in parent component called child component in aura iteration. Based on the data in the list of the parent component number of child component getting created and in child ...
3
votes
1
answer
117
views
Is "error" a reserved CustomEvent type?
I am trying to dispatch errors up from a child component to its parent. However, when my code looks like the below, I get two errors.
Code:
dispatch(error) {
this.dispatchEvent(new CustomEvent(&...
1
vote
1
answer
57
views
Refresh custom lightning component when another custom lightning component call refresh
I have two custom components added in flexipage. I want to refresh component A with latest data when a certain action is performed on component A
// cmp 1
<aura:component implements="...
0
votes
0
answers
18
views
event parameters are not coming in second controller,In first component account was inserting and in contact accountId was not reflecting
event 1
<aura:event type="APPLICATION" description="Event template" >
<aura:attribute name="accId" type="string" />
</aura:event>
...
0
votes
1
answer
240
views
LWC event listeners not responding
I have an LWC child component that is dispatching a custom event as such:
console.log('bw: fire saveslotclick custom event');
//fireCustomEvent(this, 'saveslotclick', { slot: this....
1
vote
0
answers
172
views
Handling Google Analytics with User Consent Cookie in Communities
We are setting up a public community (LWR template) and want to use Google Analytics. As there is the Google Consent Mode (see good explanation here) and the new Lightning User Consent Cookie Module, ...
0
votes
1
answer
60
views
Show/Hide OOB SAVE button on LWC datatable on an event fire
I have a LWC component embed in column of LWC Datatable using custom data types. Now I want to show/Hide OOB datatable Save button on an event fire from embed LWC component.
sdGridCustomDatatableChild ...
0
votes
0
answers
372
views
How onclick will work if the button on the parent lwc component and the lightning-record-edit-form is on the child lwc component?
I have tried to create LWC's for a record creation/ Update like below.
Parent LWC component,
<template>
<lightning-button variant="brand" label="Click Here" title="...
0
votes
1
answer
219
views
How to pass Object type attribute value from child to parent in Aura?
On clicking of a button in child Component I'm passing the "Object and String" type attribute values from Child to Parent using the Component Event. The Problem here is I'm not able to ...
0
votes
0
answers
23
views
Can we call custom label in application event while setting the event attribute if yes then what will be the syntax. see my docNotSignedAtr
function(response){
//Bug-8928---Prod issue resolution start-Amit>08-02-2022
if(response == null){
console.log('null response from requestSignedDocument '+...
0
votes
0
answers
20
views
onConnectionError event in Einstein bot
IN what scenario does the onConnectionError occur and is it only when the chat is ended does this event gets fired.What I can see is that the event only gets triggered after the chat is ended by the ...
0
votes
1
answer
83
views
What is the correct way to pass parameters to Lightning JS controller from anchor <a>
I have anchor tag in the lightning component and trying to get the value on user click the hyperlink.
//cmp
<aura:iteration items="{!v.refDataList}" var="refData" indexVar="...
2
votes
2
answers
637
views
Component is not refresh during 2nd attempt after clicking on new button
I have overridden Standard New button on lead object with Aura Component and this Aura calls LWC which contains record edit form to create new lead record.
I have 2 record types Record Type 1 & ...
0
votes
1
answer
249
views
Event Dispatch is not working
I am updating a value for a record using lightning-record-edit-form update in the child component. After updating the record, I want to pass the updated record to the parent. It is not get passed when ...
0
votes
1
answer
274
views
LWC Can Variables Be Reset & Further Events Fired After Returning From a Back-Button/PopState
I have a requirement where I need to update values in an LWC when returned from a back-button popstate.
E.G.
window.onpopstate = function(event) {
if(event && event.state) {
// ...
0
votes
1
answer
1k
views
Calling Aura Event in LWC
I have a simple Aura component which is registering a managed package event and then firing it.
I need to call this custom_app:LoadAppEvent from lwc component instead from an Aura component. is there ...
1
vote
2
answers
1k
views
LWC event.currentTarget.value is undefined in production but works in sandbox
I have the below code for creating a list of checkbox's to select multiple options to filter a datatable. The code works fine within the sandbox however once i moved the code to the production org the ...
1
vote
0
answers
114
views
Manually Trigger cellchange Event on Datatable
Is there a way to manually trigger the cellchange event on a datatable?
I'm using a custom datatable that allows a custom data type - a dropdown (combobox) - it's based on this custom datatable.
I ...
0
votes
0
answers
38
views
An event doesn't fire
I have three lightning component - recordList, customLookup and newProdOrderWindow. I am selecting a record in recordList, giving it's id to customLookup with a help ow event and would like to give it'...
0
votes
1
answer
928
views
LWC unable to call onclick function from input element
I am new to LWC and trying to translate an existing VF page into LWC. I am trying to call an onclick function (pretty simple) but the function is not firing. Can anyone help me troubleshoot why this ...
1
vote
0
answers
130
views
CloseActionScreenEvent bubbles
Here I've read that CloseActionScreenEvent does not bubble, but we can set in the constructor a EventInit object to force bubbles = true. So I have the following this.dispatchEvent(new ...
0
votes
0
answers
788
views
How to catch horizontal scroll event of a LWC lightning data table to implement fixed column in datatable
EDIT : Background of original requirement.
We want to implement a "freezed" 1st column in a custom lightning datatable. When we scroll to the right, 1st column should always be in view. ...
1
vote
1
answer
213
views
Lightning: Edit recurring event series causes trigger to fire twice
In trying to create a trigger for recurring events, I'm noticing the trigger firing twice.
I'm doing this on a new and clean developer org, so no existing workflows, processes, flows, or triggers.
...
0
votes
1
answer
366
views
Get name from Checkbox Group onchange event in Lightning Web Component
I currently have a checkbox group in a lightning web component and I have an onchange function setup to handle a selection. I have been reading the documentation, but can't find any information to ...
7
votes
2
answers
6k
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 ...
0
votes
1
answer
1k
views
Unable to close quick action from LWC (from Web component)
I'm directly using LWC component in the Quick Action through flow, once the submit button is called I'm dispatching an event from LWC but aura is not capturing and also Quick action modal is not ...
0
votes
1
answer
427
views
Aura handler is calling his action twice
<aura:handler event="c:ResultApplicationEvent" action="{!c.onResultHandler}" />
This is an aura Handler. this is the only handler present in my project which is handling ...
0
votes
1
answer
425
views
$A.get("e.force:navigateToURL") not firing in lightning out - Needs Alternative
I have embedded the lightning component into my VF page.
In the lightning component I am using $A.get("e.force:navigateToURL"); to navigate to a URL.
Since I am calling the lightning ...
0
votes
1
answer
2k
views
Fire an event on enter button press in LWC
I am trying to implement a button that will fire a search event when it is clicked and also when enter button is pressed. How to listen to the enter button press? This is the code for my button.
&...
0
votes
2
answers
344
views
Error while using custom events in lwc
I am trying to setup child to parent communication in lwc but i get error
No MODULE named markup://c:customEventChild found : [markup://c:customEventParent]
CustomChildEvent.html
<template>
<...
0
votes
1
answer
286
views
how to assign value from parent button click to child picklist component value LWC
I have below parent component and child component . From Parent component button click i want to assign child component picklist value as Cold. But its not working.
Parent HTML
<lightning-...
0
votes
1
answer
241
views
lightning:tabClosed event throwing error when calling apex method
I am calling apex method on lightning:tabClosed event to update a record on closing the tab. I can see the record Id being passed to controller method but query is throwing an error saying
{"...
0
votes
1
answer
148
views
Fire 2 events at a time
I'd like to fire 2 events at a time but it only executes the first .fire() method. I've got 2 events for showing and hiding of multiple lightning components. Can anyone suggest if how can I implement ...
1
vote
1
answer
885
views
How to get child component values while on save LWC
I have this child component
<c-picklistutility class="meettype" value={typevalue} object-name="TestObj__c" field-name="TestF__c"
onselected={handleChange}>&...
0
votes
1
answer
21
views
get the changes(e.g create account, add contact, new value entered in the field ) made by user in the org in salesforce
What are the possible ways in salesforce so that i can get the field record changes in the org.
i want to get the changes made by user to certain field and send it to a group in a chattool.
How can i ...
0
votes
1
answer
480
views
get the event of a component, get the value and push to Array
I replaced one of my input field for a custom lookup component. I can get the value of it and add it to a variable. The problem I have is I need to push it to an Array and I cannot get the name of the ...
0
votes
0
answers
22
views
How can I transfer id from comp1 to comp2 when comp2 loads after a button click on comp1?
Comp1 and comp2 are 2 lightning component and are not in any relationship of parent-child. I used application in comp1 to fire and it is handled in comp2.
Event
<aura:event type="APPLICATION&...
0
votes
1
answer
72
views
How to publish data from LWC to the components outside managed package?
I have created a standard LWC datatable in a managed package (let's call this managed LWC component as ComponentA) which will be called in a normal non-packaged LWC component(let's call this as ...
0
votes
1
answer
53
views
Input text won't clear on subsequent clicks
I have an aura component application in my community. It's a gridview of cases that filters on various attributes, dates, statuses and a text field that filters by case number. I have a new task to ...
0
votes
1
answer
157
views
LWC - Exception when calling child function more than once
I'm having an issue while developing an LWC and was hoping someone could help as the error isn't super clear to me.
I have LWC A which contains LWC B (check example code below):
<div ...
0
votes
0
answers
490
views
How can we add onblur event for lightning:inputField
I need to add onblur event for lightning:inputField. Right now as per the documentation (https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField) I dont see a direct by ...
4
votes
1
answer
289
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 ...
0
votes
2
answers
282
views
Is `event.getParams()` expensive?
If I have to use a param from the event in a loop, is it better to extract the params to a variable before (e.g. const params = event.getParams()), and use that variable instead of calling event....
0
votes
0
answers
41
views
Events between components not on the same system
As the question goes, what can I use to communicate between 2 LWC components which are accessed by different users?
I am trying to build a Sprint planning poker app in LWC, where the vote submitted by ...
0
votes
0
answers
32
views
Highlight the Validation Error on the corresponding Field
Can anyone tell how the implementation of highlighting the validation error at field level can be achieved using Lightning Aura Components?
I have tried using validity functionality option in my code ...