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

Can anyone let me know why my date is not getting and setting?
public class TaskController { ... public Task objTask { get { if(objTask == null) objTask = new Task(); return objTask; } set; } ... } <apex:form > <apex:sectionHeader title="Change Due Date Section" /> <h1>Enter new Due Date: </h1> <apex:inputField value="{!objTask.ActivityDate}"/> </apex:form>
When I run a debug, the objTask.ActivityDate is always returning null no matter what value I put in the Date Picker field.
Any ideas why the values is not being returned properly to the custom controller?
Thanks.
You need to add a command button to call some method in order for the value to be set. Simply entering a valu in the inut box does not set it.
See my post here if you have trouble with the command button:
http://boards.developerforce.com/t5/Visualforce-Development/How-to-pass-Paramater-using-CommandButton-A-Tutorial-Lessons/m-p/424215
All Answers
You need to add a command button to call some method in order for the value to be set. Simply entering a valu in the inut box does not set it.
See my post here if you have trouble with the command button:
http://boards.developerforce.com/t5/Visualforce-Development/How-to-pass-Paramater-using-CommandButton-A-Tutorial-Lessons/m-p/424215
Awesome!!!
I used your doNothing method and then added the actionSupport
<apex:form >
<apex:sectionHeader title="Change Due Date Section" />
<h1>Enter new Due Date: </h1>
<apex:inputField value="{!objTask.ActivityDate}">
<apex:actionSupport event="onchange" action="{!doNothing}" />
</apex:inputField>
</apex:form>
And it works now.
Thanks again for the help.