• Abhijit Thote
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

 

 

HI,

 

I am trying to get two values from the user input .  I am getting error as 

 

<apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.

 

 

 

Controller

---------------

 

public class  AdditionController
{
  
  public integer A;
  public integer B;
  
  public AdditionController addctl{get;set;}
  
  public integer getA()
  {
     return this.A;
  }
  
  public void setA(integer val)
  {
      this.A=val;
  }
  
  public integer getB()
  {
     return this.B;
  }
  
  public void setB(integer val)
  {
      this.B=val;
  }
   
 
}

 

 

VF Page

---------------

<apex:page controller="AdditionController">
    <apex:form >
        <apex:inputField id="A" value="{!addctl.A}"/>
        <apex:inputField id="B" value="{!addctl.B}"/>
   </apex:form>

</apex:page>

 

 

Thanks.