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:...
  • 146k
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....
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. ...
  • 5,319
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 ...
  • 19.7k
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:...
  • 7,665
3 votes
Accepted

Can I access an apex:inputField onchange value in my controller/extension without saving the record?

Few changes in your code <apex:inputField value="{!caseRec.AssetID}"> <apex:actionSupport event="onchange" action="{!determinePageBlock}" reRender="{!pageBlockList}" /> </apex:...
  • 22.2k
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, ...
  • 132k
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 ...
  • 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) { ...
  • 2,674
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: ...
  • 132k
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 ...
  • 3,821
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 ...
  • 154
2 votes

actionFunction behavior differ for inputCheckbox and inputText

The possible reason for this behaviour can be Areas of the page are being rerendered, but not a page messages component, and an required field is missing or a validation rule is failing. In this ...
2 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-...
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 ...
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 ...
  • 456k
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 } }
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 ...
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 ...
  • 456k
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 ...
  • 349
1 vote

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

Since the Strike Lookup ultimately renders HTML elements, you can handle DOM events fired by the child HTML elements by wrapping them with a div and defining attributes for the specific DOM events ...
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 ...
  • 13.1k
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 -->...
  • 456k
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}" ...
1 vote
Accepted

actionFunction behavior differ for inputCheckbox and inputText

Ended up with an alternative. Added actionSupport for inputText fields to be fired in the onchange event. Working as expected. <apex:inputText id="quantity" value="{!item.quantity}" > <...
  • 6,201
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('...
  • 12.4k
1 vote

Can I access an apex:inputField onchange value in my controller/extension without saving the record?

When we use immediate="True" Salesforce bypass the view state and never bind the visualforce page variable with controller properties which cause this issue. By default immediate attribtute is false ...
  • 10.4k

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