+ Start a Discussion

custom settings into an existing multi select picklist in visualforce

Hi All,

How to add list custom settings into an existing multi select picklist in visualforce?

VF Page

<apex:selectList value="{!selectedValue}" size="1" multiselect="false">
                                 <apex:selectOptions value="{!MyOptions}"/>


public List<SelectOption> getMyOptions(){
    List<SelectOption> options = new List<SelectOption>();     

    // Reading picklist values and labels
    Schema.DescribeFieldResult fieldResult = Investor_Profile__c.Investor_Groups__c.getDescribe();
    List<Schema.PicklistEntry> picklistEntries = fieldResult.getPicklistValues();

    // Adding apicklist values to the select list
    for(Schema.PicklistEntry entry : picklistEntries){
        options.add(new SelectOption(entry.getValue(), entry.getLabel()));
    // Now adding custom settings to the select list
     for(Investor_Details__c setting : Investor_Details__c.getAll().values()){
        options.add(new SelectOption(setting.name, setting.name));
       return options;

with this code am getting the picklist values but i need to get the multi select picklist values.
Reply ASAP....
Thanks in Advance....:)

     Set the multiselect attribute in <apex:selectList> to true to select more than one value set the size accordingly