You need to sign in to do that
Don't have an account?
Shwetal Desai
Problem in passing data to apex class used as extension
Hi,
The problem I m facing must be solved by so many developers.
I m trying to set public variable value in apex class from VF page.
VF Page uses StandardCotroller and that apex class as an extension
but that public variable not being set... :womansad:
I need proper guidence.... :womanindifferent:
here is the source code: VF Page
<apex:inputText id="clientid" value="{!clientId}"/>
Apex Class
Apex Class
public class PointOfSale
{
public ID clientId;
public ID getclientId()
{
return clientId;
}
public void setclientId (ID txt)
{
clientId = txt;
}
private final POS__c pos;
public PointOfSale (ApexPages.StandardController controller)
{
this.pos = (POS__c)controller.getRecord();
}
{
public ID clientId;
public ID getclientId()
{
return clientId;
}
public void setclientId (ID txt)
{
clientId = txt;
}
private final POS__c pos;
public PointOfSale (ApexPages.StandardController controller)
{
this.pos = (POS__c)controller.getRecord();
}
}
Is it becoz m using this class as extension?
Any Idea/Sugession/ help ???
Thanks
does it work if you declare the variable as a string instead of an ID
you have no debug statements to verify the value?
how do you know it's not working?
HI Shwetal,
The get, set methods should automatically fetch the client id entered in your vf page.
Try the below code and check if it works: