0

I'm trying to do two things here :

  1. catch an on-change event on a picklist using: <force:inputField>. and get the aura: Id
  2. 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

  • Please go through this link ,this will be helpful. – Shilpa Nov 12 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.