I'm trying to do two things here :
- catch an on-change event on a picklist using:
<force:inputField>
. and get the aura: Id - getting the translated value and not just the API.
CMP:
<aura:attribute name="schol" type="Scholarship__c" default="{'sobjectType': 'Scholarship__c'}" />
<force:inputField aura:id="rty" value="{!v.schol.Scholarship_Type__c}" change="{!c.changeSelect}"/>
Controller:
changeSelect : function(component,event,helper){
console.log(event.getSource().get('v.value')); // Get the API name value.
console.log(event.getSource().getLocalId()); // undefined
console.log(event.target.id);// Error: Cannot read property 'id' of undefined;
},
I know that for event.target.id I need id param and not the aura: id inside the component but That not working either.
I prefer to avoid using init handler to get the picklist field using apex - if that possible.
Many thanks