+ Start a Discussion
Dhruv NirgudeDhruv Nirgude 

In UI page there is no chnage after writing VF codes and Apex class.

Here are my VF codes and Apex Class 

<apex:page controller="Calc" >
     <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <apex:pageBlock title="Contact Edit" Tabstyle="Contact" id="tryReneder">
       <apex:commanButton action="{!add}" value="Add" Reneder="tryReneder"/>
         <apex:commandButton action="{!redirect}" value="navigate"/>
        <apex:pageBlockSection columns="2">
                <apex:outputLabel value="Input1"/>
                <apex:inputText value="{!input"}/>
                   <apex:outputLabel value="Input2"/>
                   <apex:inputText value="{!input}"/>
              <apex:outputLabel value="output"/>
              <apex:inputText value="{!output}"/>

public class Calc {
    public Integer input1;
    public Integer input2;
    public Integer output;
    // Constructor
    public Calc(){
        this.output=0; //
//Getter and Setter method
//Getter method to get value from Apex to VF page
//Setter method is to set values from VF to Apex class
    public Integer getInput(){
        return input1;      
    public void setInput1(Integer input1){
    public Integer getoutput(){
        return output;
    public void setoutput(Integer output){
    public Integer getinput2(){
        return input2;
    public void setinput2(Integer input2){
        //add Method
    public void add(){
    // Redirect method to demo pagereference
    public PageReference redirect(){
        pagereference p = new PageReference('/apex/CustomCalcContact');
        return p;     
SwethaSwetha (Salesforce Developers) 
HI Dhruv,
What are the expected changes on UI? Are you seeing any errors while executing the code?
Dhruv NirgudeDhruv Nirgude
Shweta i got this error- Read only property 'Calc.input' 
and it's a Calc UI so i expected input and output when i entered the two values then i'll get output on UI.