2016-03-29 3 views

Antwort

0

Die Logik zur Durchführung der Berechnung hängt davon ab, ob Sie dies auf Controller-Ebene oder auf Client-Seite tun möchten.

Für Controller: Auf einen Klick auf die Befehlsschaltfläche Aktionsmethode in Salesforce aufrufen.

<apex:page controller="MathematicalOperations"> 
    <apex:form id="frm"> 
     <apex:inputText value="{!inputValue1}" id="theTextInput1"/> 
     <apex:inputText value="{!inputValue2}" id="theTextInput2"/> 
     <apex:outputText value="{!calculateSum}" id="sum"/> 
     <apex:commandbutton action="{!calcuateSum}" value="Calculate Sum" rerender="frm"/> 
    </apex:form> 
</apex:page 

>

public class MathematicalOperations() 
{ 
    public decimal inputValue1{get;set;} 
    public decimal inputValue2 {get;set;} 
    public decimal sum {get;set;} 
    public void calculateSum() 
    { 
     sum = inputValue1 + inputValue2; 
    } 
} 

Wenn meine Lösung Ihr Problem gelöst hat es bitte markieren, wie gelöst.

Danke, Mayank

Verwandte Themen