You need to sign in to do that
Don't have an account?
Binu 8
Input filed binding with controller not working properly
Hi Team,
I have a custom controller which name is "PaypalProccessor",
The code is,
public class PaypalProccessor{
public string amount {set;get;};
public String balance {set;get;}
public string FirstName{get; set; }
public String doDirectPayment()
{
}
}
And in my Visual force page I want to enter these 3 details in to an input field,The code is
<apex:page controller="PaypalProccessor">
<apex:form>
<apex:pageBlock title="Paypal Payment">
<apex:outputLabel value="Amount" for="amt"/>
<apex:inputField value="{!PaypalProccessor.amount}" id="amt"/>
<apex:commandButton value="save" action="{!doDirectPayment}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
But I am facing this error in VF,
Unknown Property 'PaypalProccessor.PaypalProccessor'.
I think the error is coming from the binding of input field and also tried value="{!amount}".
That time the error will be ,
"Could not resolve the entity from <apex:inputField> value binding '{!amount}'.
<apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable."
I have a custom controller which name is "PaypalProccessor",
The code is,
public class PaypalProccessor{
public string amount {set;get;};
public String balance {set;get;}
public string FirstName{get; set; }
public String doDirectPayment()
{
}
}
And in my Visual force page I want to enter these 3 details in to an input field,The code is
<apex:page controller="PaypalProccessor">
<apex:form>
<apex:pageBlock title="Paypal Payment">
<apex:outputLabel value="Amount" for="amt"/>
<apex:inputField value="{!PaypalProccessor.amount}" id="amt"/>
<apex:commandButton value="save" action="{!doDirectPayment}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
But I am facing this error in VF,
Unknown Property 'PaypalProccessor.PaypalProccessor'.
I think the error is coming from the binding of input field and also tried value="{!amount}".
That time the error will be ,
"Could not resolve the entity from <apex:inputField> value binding '{!amount}'.
<apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable."
Thanks,
Karanraj (http://www.karanrajs.com)
All Answers
Please use followong VF Code:
If its helps, please mark as best answer so it will help to other who will serve same problem.Thanks!
"Could not resolve the entity from <apex:inputField> value binding '{!amount}'.
<apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable."
Try following code:
If its helps, please mark as best answer so it will help to other who will serve same problem.
Thanks!
Thanks,
Karanraj (http://www.karanrajs.com)