I have a custom field of date in opportunity . i need to display the date in visualforce page using inputfield, so that i can edit and save the form later. for that i am doing
visualforce page
<apex:inputfield value="{!oppList.date__c}"/>
controller
public class SurveyFormController
{
public string opportunityId{get;set;}
public Opportunity oppList{get;set;}
public SurveyFormController(ApexPages.StandardController stdController)
{
opportunityId = Apexpages.currentPage().getParameters().get('oppId');
this.oppList=[select id,Date__c from opportunity where id=:opportunityId];
}
}
I am able to get the datepicket in page but i am unable to prepopulate the value . could any one guide me up
[select id,Date__c from opportunity where id=:opportunityId][0];