• Emilien Guichard 59
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hello there,

I am having a hard time trying to get lightning:select component selected value in controller :

Here is my code :
component :
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    
        <!-- handlers-->
        <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
            <lightning:select name="distance" label="Distance ?" onchange="{!c.onChange}">
                <option value="10km">10</option>
                <option value="25km">25</option>
                <option value="50km">50</option>
                <option value="100km">100</option>
            </lightning:select>
           
</aura:component>
controller:
({
     
init: function (component, event, helper) {
    
    	console.log('distance ' + component.find("distance").get("v.value"));

    },
    
    onChange: function (component, event, helper) {
    	console.log(component.find("distance").get("v.value"));
    }
})
wheh the page loads or when I change the picklist value, I get his error message :
 
Action failed: c:map$controller$init [component.find(...) is undefined]

Thanks a lot for your help !

 
Hello there,

I am having a hard time trying to get lightning:select component selected value in controller :

Here is my code :
component :
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    
        <!-- handlers-->
        <aura:handler name="init" value="{!this}" action="{!c.init}"/>
    
            <lightning:select name="distance" label="Distance ?" onchange="{!c.onChange}">
                <option value="10km">10</option>
                <option value="25km">25</option>
                <option value="50km">50</option>
                <option value="100km">100</option>
            </lightning:select>
           
</aura:component>
controller:
({
     
init: function (component, event, helper) {
    
    	console.log('distance ' + component.find("distance").get("v.value"));

    },
    
    onChange: function (component, event, helper) {
    	console.log(component.find("distance").get("v.value"));
    }
})
wheh the page loads or when I change the picklist value, I get his error message :
 
Action failed: c:map$controller$init [component.find(...) is undefined]

Thanks a lot for your help !

 
Hi, Im getting the above error when try to refresh the dashboard and check the challenge, the full error message is "There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: GAQSDJRQ" I created the trailhead playground this afternoon and nothing has been installed minus the managed package that for the badge

Any help would be appreciated!
Matt