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

Problems capturing date value using input field on Visual Force Page
I have been working on this issue for a few days now, trying to understand why this form will not capture the date entered using the standard salesforce functionality and date picker. What is weird is that I have another form using the exact same code to capture a date and it is working perfectly.
There are no referenced to the field in the controller for either page, yet the page that I have included below does not save the date, while the other form does.
This is the code for the inputfield that should store a value to NewForm.Date_Needed__c, I ripped right out of my component for the form:
<apex:pageBlockSectionItem > <apex:outputLabel >When is the new account required by? </apex:outputLabel> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:inputField required="true" value="{!NewForm.Date_Needed__c}"/> </apex:pageBlockSectionItem>
The only difference in the use of the code snippet between forms is placement. This is the second set of pageblocksection items in the pageblocksection for the form I am having trouble with, while the other form has it as the last set of items before the pageblocksection is closed. Any help would be appreciated, I understand this isnt much to go off of, I will upload my component and controller if anybody would find it helpful. I am hoping there is something wrong with this snippet, making this problem an easy fix.
For anyone else who happens to run into a similiar issue, the solution was actually simple. I was creating TWO new forms in my code, one amongst the variables declared at the top of my controller, and another in the getNewForm method, when I removed the second declaration from the getNewForm method, and simply instantiated the first form object, the date value was passed to my controller as expected.
The issue explained in the simplest way possible was that I was creating a new form, setting the Date Needed value, then creating another new form with all the rest of the data and that is why the date was not being stored.
All Answers
share the complete page.. remove required='true' and use <Inputtext> insted of <inputField>
if it will not work then share the page .. will try it..
Navneet,
I have removed the required attribute and changed the inputField to an inputText. The value is still not being stored.
Visual Force Page:
<apex:page sidebar="false" tabStyle="Agile_Account_Request_Form__tab" >
<apex:messages />
<c:AARFComponent />
</apex:page>
Controller:
Component:
For anyone else who happens to run into a similiar issue, the solution was actually simple. I was creating TWO new forms in my code, one amongst the variables declared at the top of my controller, and another in the getNewForm method, when I removed the second declaration from the getNewForm method, and simply instantiated the first form object, the date value was passed to my controller as expected.
The issue explained in the simplest way possible was that I was creating a new form, setting the Date Needed value, then creating another new form with all the rest of the data and that is why the date was not being stored.