I am trying to implement a picklist using the Aura component <ui:inputSelect>
with a change event listner. But I see that the change event listener (JavaScript function) is not getting registered with the component.
Below is my component markup
And this is the code in my JS controller:
onChangeFunction: function(component) {
console.log(component.get('v.value'));
}
Please see that in Chrome web inspector, there is no change event listener registered for the component. So, if I change the value of the picklist component, the onchange event listener function "onChangeFunction" in my controller is not getting invoked. This is my problem
Best Answer
Since you haven't given
value
attribute for the<ui:select/>
component, you could doselectCmp.get("v.value")
since it is internally available.Click here to find more attributes that are available in the component.If the value is attribute is binded to
aura:attribute
, you could do below:Method in Controller.js should look like this:
--Update--
I tried to reproduce the issue,but
change
function works at my end.Component:
Controller.js: