You need to sign in to do that
Don't have an account?

Display date field on VF
I am trying to show the date as calander on first page load. Then user can change the date.
After that, if button is pressed, that selected date value should be passed to controller.
Now I can't even display the initial value to VF page.
How I can set it up?
here is my apex
public Date startDate {get;set;}
//constructor
public Class_Test()
{
startDate = date.today();
}
here is my VF.
<apex:page controller="Class_Test" id="VF_Class_Test" cache="FALSE" showHeader="FALSE" sidebar="FALSE" tabStyle="blah">
...
<apex:inputField value="{!startDate}"/>
hi TheDoctor,
If I set the system.today() in getter of startDate, whenever I try to get the startDate..I will get the today everytime.
My requirement is the user will change the startDate from the datetime picker from UI.
I only want to display the initial value of startDate at formload as today.
And I follow this example. and it is working.
Thanks everyone.
All Answers
Try this in your class instead:
and get rid of the Class_Test() method you have there.
Hope this helps.
hi TheDoctor,
If I set the system.today() in getter of startDate, whenever I try to get the startDate..I will get the today everytime.
My requirement is the user will change the startDate from the datetime picker from UI.
I only want to display the initial value of startDate at formload as today.
And I follow this example. and it is working.
Thanks everyone.