+ Start a Discussion
Abhishek_NewAbhishek_New 

Populate picklist from the custom object to the Visualforc​e page

I have my Custom object candidate within which a pickilist is there named "Education".Now I want to create a customer registration form in visual force..How I can do it? I have tried the following way:

Visual force:

 

<apex:page controller="Candidate"  >
<apex:pageBlock title="Candidate Registration">
<apex:form >
<apex:pageBlockSection >

<apex:selectList label="Education" value="{!Education}">  

<apex:selectOptions value="{!statusOptions}" /> </apex:selectList>

</apex:pageBlockSection>

</apex:form>

</apex:pageBlock>

</apex:page>

 

controller Apex:

 

public with sharing class Candidate {

    public List<SelectOption> statusOptions { get;set; }        

   

???? How to get the PICKLIST values????

 

    public String Education {get;set;}

                                                           }

 

 Please help ..I am new to Salesforce domain....

 

PrakashbPrakashb

If the Candidate object is your controller, you can directly use the

 

<apex:inputfield> option to display the picklist.

 

If you want to et the picklist values and use it for some other reasons then you need to use the getdescribe option in order to get the  values.

asish1989asish1989

Hi

    will you please check this......

      If you want all picklist values then simple write 

       <apex:inputField value="{!candidate.Education__c}"

      If you want  single value which will be choosen from picklist in Vf page for more procceing  then use action function .

 

 

    Let me know what's your requirement

 

 

 

Thanks

asish