Skip to main content
4 votes

Lightning - onChange issue

You have to use aura:id instead of name. Try this : <lightning:select aura:id="wallheight" label="Wall Height : " onchange="{!c.doSomething}"> <aura:iteration items="{!v....
Junaid P Khader's user avatar
4 votes
Accepted

Page not re-rendering on change? Method not working?

You used a self closing input. You need to leave it open to nest the actionSupport under it. Incorrect <apex:inputField ... /> <apex:actionSupport ... /> Correct <apex:...
Adrian Larson's user avatar
  • 151k
4 votes
Accepted

Which is preferable and why: onchange or template.querySelector

I did wonder if querySelector is more performant as it doesn't raise an event but that seems a bit moot. The onchange event is always raised, you simply don't handle it in the querySelector example. ...
RubenDG's user avatar
  • 8,762
3 votes
Accepted

How to Get the Current Value from a Lightning-Input-Rich-Text

Avoid using onChange and may be use the querySelctor instead as shown below <template> <lightning-input-rich-text value={myVal}> </lightning-input-rich-text> <lightning-...
Mohith Shrivastava's user avatar
3 votes
Accepted

Can you give custom attribute to select options in LWC?

the onchange should only reside on the lightning-lightning-checkbox-group component, if you add it to your options, they wont individually trigger when the value changes. you want to handle everything ...
glls's user avatar
  • 20.2k
3 votes

Lightning: Detecting attribute changes after initial value

I am assuming you are loading values for parent attribute from init handler thats why it gets set as undefined initially. ' There are few ways to handle it: Put the child components inside an aura:...
RedDevil's user avatar
  • 7,841
3 votes
Accepted

Rerender Typeahead Custom Component

That component sets up the jQuery code using: j$(document).ready(function(){ j$('#{!searchBoxId}').typeahead({ minLength: {!minSearchLength}, hint: true, ...
Keith C's user avatar
  • 136k
2 votes

onchange event listener for ui:inputSelect not working

Since you haven't given value attribute for the <ui:select/> component, you could do selectCmp.get("v.value") since it is internally available.Click here to find more attributes that are ...
Praveen's user avatar
  • 10.1k
2 votes

How to get before/after information from change events

The below link details on how to capture old and new values. Lightning Change Event So we access the values in the controller as follows: ({ numberChanged : function(component, event, helper) { ...
Hemant Jain's user avatar
  • 2,785
2 votes
Accepted

Aura Lightning On Change

Your component has the v.selectedValue attribute (whereas ui:inputSelect has a v.valueattribute) so in your onChange it would be: component.get("v.selectedValue") to access that value not: ...
Keith C's user avatar
  • 136k
2 votes

How can I get my class to pull the exact record that made the trigger run?

To send the list of records to your class, you should prepare a list of such records which satisfy your trigger criteria. Below is example: trigger UpdateLastActivitySubject_trigger on Lead (before ...
Rohit Mourya's user avatar
  • 3,871
2 votes
Accepted

How do I clear a selected onchange value from an aura component on reload?

You have to assign an aura:id to the second combo-box like below. <lightning:combobox aura:id="periodFreqs" name="periodFreqs" label="Statement Period Frequency" placeholder="Select a Period ...
samdev's user avatar
  • 154
1 vote

Page not re-rendering on change? Method not working?

You need to include actionsupport inside your inputfield <apex:inputField value="{!Loan_Memo__c.Relationship__c}" > <apex:actionSupport event="onchange" action="{!getrelatedcovs}" ...
Tushar Sharma's user avatar
1 vote

LWC event.currentTarget.value is undefined in production but works in sandbox

Changed Approach to fix this. Instead of using a lighting-input within the lightning-button-menu and having the input check for the onchange moving the logic around and using lightning-menu-item and ...
TimChadwick's user avatar
1 vote
Accepted

LWC Html table with lightning-input onchange giving error

@api configureorderitemlist // passed from parent This indicates that your data is read-only. You can't modify it. The typical way to handle this is to notify the parent that a change needs to be ...
sfdcfox's user avatar
  • 497k
1 vote

Adding a placeholder in <lightning-textarea > is causing triggering of onchange event on it in IE browser

You can try following workaround in Your handler: handleChange(event) { if(event.target.value !== 'Enter value') { //Your logic here } }
osieckiAdam's user avatar
1 vote
Accepted

How to get fieldName when inputfield updated

TLDR : event.getSource().get("v.fieldName") or component.find("auraId").get("v.fieldName") If you want to fetch fieldName based on aura:id then component.find would return an array, where you can use ...
Pranav Parakh's user avatar
1 vote
Accepted

How can you get the caret position when working from an event?

To answer your question directly, Salesforce would have to expose these attributes to you with additional code, etc. As such, there's no way to access the attributes unless they were exposed. You can ...
sfdcfox's user avatar
  • 497k
1 vote

Add onchange event for lightning:inputField in $A.createComponents

I found a workaround. I just put the onchange event on the parent div as shown below. However, it would be nice to be able to assign it directly to lightning:inputField. I assume there is a bug in the ...
Chris K.'s user avatar
  • 349
1 vote

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

Even if you use HTML5 events, the native event gets wrapped by Locker Service, so you won't necessarily have access to all of the event attributes that you might expect if you weren't working with ...
Aidan's user avatar
  • 13.8k
1 vote

not being able to get apex element id in javascript method

I find that trying to query by Id is challenging to do accurately in Visualforce. Instead, just use an HTML passthrough attribute and query on that instead. <!-- Visualforce element you want -->...
sfdcfox's user avatar
  • 497k
1 vote

onchange event listener for ui:inputSelect not working

In your javascript controller function, you should find the ui:inputSelect component first, and then get the value of that: onChangeFunction: function(component) { console.log(component.find('...
martin's user avatar
  • 12.7k

Only top scored, non community-wiki answers of a minimum length are eligible