I have a custom object(survey__c) and custom field which holds the picklists values of the month (month__c). i want to use these picklist values in vf page.... i am using a custom controller in vf page .....can anyone help in resolving this issue with an example .
vf page :
<apex:selectList id="Months" value="{!Survey__c.Month__c}" size="1" required="true">
<apex:selectOptions value="{!months}"/>
</apex:selectList>
<p/>
controller :
public List<SelectOption> getMonths()
{
List<SelectOption> options = new List<SelectOption>();
Schema.DescribeFieldResult fieldResult = Survey__c.Month__c.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
for( Schema.PicklistEntry f : ple)
{
options.add(new SelectOption(f.getLabel(), f.getValue()));
}
return options;
}
it is giving error as -
Unknown property : 'CommunitySurveyContrller.Survey__c'