October 30, 2015

The client side controller does not get a value from the inputOne, inputTwo and/or inputThree components

Use the below codes

Component Code:

<aura:component >
<ui:inputNumber aura:id="InputOne"/>
    <ui:inputNumber aura:id="InputTwo"/>
    <ui:inputNumber aura:id="InputThree"/>
    <ui:outputNumber aura:id="totalValue"/>
    <aura:handler name="init" value="{!this}" action="{!c.calculate}"/>

Controller Code:

    calculate : function(cmp) {
Var ip1 = cmp.find("InputOne").get("v.value");;
Var ip2 = cmp.find("InputTwo").get("v.value");;
Var ip3 = cmp.find("InputThree").get("v.value");;
        cmp.find("totalValue").set("v.value",  parseInt("ip1") +  parseInt("ip2") +  parseInt("ip3"));


No comments:

Post a Comment