You need to sign in to do that
Don't have an account?
Abhishek Singh 116
<apex:InputText> is not passing value to the controller variable.
I have a inputText field in visualforce page like below:
<apex:inputText id="brhdate" size="10" value="{!findValue}" onmouseover="initialiseCalendar(this, '{!$Component.brhdate}')" />
I used Get, Set in the controller like below:
public String findValue {
get {
Date dt = contact.Birthdate;
findValue = dt.format();
return findValue;}
set;
}
Get function is simply fetching the existing Birthdate value from contact in locale format and returning string.
Now in my main class when I use this variable, it didn't give the value which I changed in visualforce page.
public PageReference saveChange() {
contact.Birthdate = Date.parse(findValue);
System.debug('Value of findValue ' + findValue)
}
When I click on save button, I only get the value which exist in the contact record already. I am not getting the new value which I changed in VisualForce page. Please help.
Thank you in advance!!
<apex:inputText id="brhdate" size="10" value="{!findValue}" onmouseover="initialiseCalendar(this, '{!$Component.brhdate}')" />
I used Get, Set in the controller like below:
public String findValue {
get {
Date dt = contact.Birthdate;
findValue = dt.format();
return findValue;}
set;
}
Get function is simply fetching the existing Birthdate value from contact in locale format and returning string.
Now in my main class when I use this variable, it didn't give the value which I changed in visualforce page.
public PageReference saveChange() {
contact.Birthdate = Date.parse(findValue);
System.debug('Value of findValue ' + findValue)
}
When I click on save button, I only get the value which exist in the contact record already. I am not getting the new value which I changed in VisualForce page. Please help.
Thank you in advance!!