function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
srikanth k 169srikanth k 169 

property 'config' of undefined

Hellow,
i am facing an error with a lightning component since this weekend. I can't figure out why this message occures.
User-added image
Appilcation:
<aura:application extends="force:slds" >
    <c:additioncomponent/>
</aura:application>
​​​​​​​
component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
<lightning:input label="enter val1" aura:id="value1" type="number"/>
    <lightning:input label="enter val2" aura:id="value2" type="number"/>
    <lightning:input label="result" aura:id="res" type="number"/>
    <lightning:button label="add" onclick="{!c.show}"/>  
</aura:component>

Controller:
({
    show :function(component, event, helper) {
        var val1=component.find("value1").get("v.value");
        alert("val1::"+val1);
        var val2=component.find("value2").get("v.value");
        alert("val1::"+val1);
        var result=parseInt(val1)+parseInt(val2);
        alert("result::"+result);
        var val1=component.find("res").set("v.res",result);
    }
})

I am able to pring the result value. not sure what is the issue with below the line.
  var val1=component.find("res").set("v.res",result);

Could some one please help me on this isuse.
 
Maharajan CMaharajan C
Hi Srikanth,

The issue is the below line (Line No: 9):  
var val1=component.find("res").set("v.res",result);  --->   var val1=component.find("res").set("v.value",result);

set("v.value")  not set("v.res")
({
    show :function(component, event, helper) {
        var val1=component.find("value1").get("v.value");
        alert("val1::"+val1);
        var val2=component.find("value2").get("v.value");
        alert("val1::"+val1);
        var result=parseInt(val1)+parseInt(val2);
        alert("result::"+result);
        var val1=component.find("res").set("v.value",result);
    }
})

Thanks,
Maharajan.C
CharuDuttCharuDutt
Hii Srikanth
I've Made Some Changes just Copy Paste 
Try The Below Code.
Componenet

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
<lightning:input label="enter val1" aura:id="value1" type="number"/>
    <lightning:input label="enter val2" aura:id="value2" type="number"/>
    <lightning:input label="result" aura:id="res" type="number"/>
    <lightning:button label="add" onclick="{!c.show}"/>  
</aura:component>


Controller

({
    show :function(component, event, helper) {
        var val1=component.find("value1").get("v.value");
        alert("val1::"+val1);
        var val2=component.find("value2").get("v.value");
        alert("val1::"+val1);
        var result=parseInt(val1)+parseInt(val2);
        alert("result::"+result);
        var val1=component.find("res").set("v.value",result);
    }
})

Please Mark It As Best Answer If It Helps.
Thank You!
Maharajan CMaharajan C
one small change :

No need of assign the result in val1.
({
    show :function(component, event, helper) {
        var val1=component.find("value1").get("v.value");
        alert("val1::"+val1);
        var val2=component.find("value2").get("v.value");
        alert("val1::"+val1);
        var result=parseInt(val1)+parseInt(val2);
        alert("result::"+result);
        component.find("res").set("v.value",result);
    }
})

Thanks,
Maharajan.C