+ Start a Discussion

How to get selected values from a picklist?

I am trying to get the picklist values from a multi select picklist but for some reason it is not coming through when exporting:

VF Page section

    <apex:form >
        <apex:pageBlock title="Article Export" mode="edit">
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton action="{!Export}" value="Email"/>

            <apex:PageBlockSection title="" columns="2" collapsible="false">
            <apex:PageBlockSectionItem >
                    <span>Article Status: </span>
                    <apex:selectList value="{!selectedArticleStatusOptions}" size="7" multiselect="true">
                    <apex:selectOptions value="{! articleStatusOptions}" />    


public with sharing class ArticleExport
        public Set<String> selectedArticleStatusOptions = new Set<String>();
    public ArticleExport()
        this.articleStatusOptions = new SelectOption[]{‘Published’,’Draft’};
    public SelectOption[] articleStatusOptions
          public get;
          private set;
    public PageReference Export()

Best Answer chosen by JO_Dev
I figured it out. Thanks

All Answers

Your Export method in controller doesn't look clear to me.

Can you please rewrite code for your Export method.....
I figured it out. Thanks
This was selected as the best answer