and here is my js controler :<aura:component >
<ui:inputNumber aura:id="inputOne" onError='{!c.handleError}' /> <br />
<ui:inputNumber aura:id="inputTwo" onError='{!c.handleError}' /> <br/>
<ui:inputNumber aura:id="inputThree" onError='{!c.handleError}' /> <br/>
<ui:outputNumber aura:id="totalValue" value="" /><br/>
<ui:button label="Calculate" press="{!c.calculate}"/>
</aura:component>
Thanks.({
calculate : function(component, event, helper) {
var inputFirst = component.find("inputOne").get("v.value");
var inputSecond = component.find("inputTwo").get("v.value");
var inputThird = component.find("inputThree").get("v.value");
var total = parseInt(inputFirst) + parseInt(inputSecond) - parseInt(inputThird);
component.find("totalValue").set("v.value",total);
}
})
Meybe I found the reason: Line 6:
var total = parseInt(inputFirst) + parseInt(inputSecond) - parseInt(inputThird);
Replace with (It must be sum):
Regards,Lukaszvar total = parseInt(inputFirst) + parseInt(inputSecond) + parseInt(inputThird);