Saturday, 26 May 2012

To perform arithmetic operations (VF)

<apex:page sidebar="false" controller="arthematic">
<!-- We should create form for inserting data into the text fields-->
<apex:form >
<!-- value atrribure in inputtext is used to set and get the values i.e date enterd in inputbox to controller & controller to vf page-->
<b>Enter value1:</b>&nbsp;&nbsp;<apex:inputText value="{!num1}"/><br/><br/>
<b>Enter value2:</b>&nbsp;&nbsp;<apex:inputText value="{!num2}"/><br/><br/>
<!--commandButton is used to create the button-->
<apex:commandButton value="Sum"/>&nbsp;
<!-- outputText to show the output-->
<apex:outputText value="{!sum}"/><br/><br/>
<apex:commandButton value="Diff"/>&nbsp;
<apex:outputText value="{!diff}"/><br/><br/>
<apex:commandButton value="Mul"/>&nbsp;
<apex:outputText value="{!mul}"/><br/><br/>


No comments:

Post a Comment