Documentation Version
Winter '16 (API version 35.0)
  • Winter '16 (API version 35.0) 35.0
  • Summer '15 (API version 34.0) 34.0
  • Spring '15 (API version 33.0) 33.0
  • Winter '15 (API version 32.0) 32.0
  • Summer '14 (API version 31.0) 31.0
  • Spring '14 (API version 30.0) 30.0
  • Winter '14 (API version 29.0) 29.0
  • English


A collection of possible values for an <apex:selectCheckBoxes>, <apex:selectRadio>, or <apex:selectList> component. An <apex:selectOptions> component must be a child of one of those components. It must also be bound to a collection of selectOption objects in a custom Visualforce controller.

This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated <input> tag for components within an <apex:selectCheckboxes> or <apex:selectRadio> parent component, or the generated <option> tag for components within an <apex:selectList> parent component.


<!-- Page: -->
<apex:page controller="sampleCon">
        <apex:selectCheckboxes value="{!countries}" title="Choose a country">
            <apex:selectOptions value="{!items}"/>
        <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
    <apex:outputPanel id="out">
        <apex:actionstatus id="status" startText="testing...">
            <apex:facet name="stop">
                    <p>You have selected:</p>
                    <apex:dataList value="{!countries}" var="c">a:{!c}</apex:dataList>
/*** Controller: ***/
public class sampleCon {
    String[] countries = new String[]{};
    public PageReference test() {
        return null;
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('US','US'));
        options.add(new SelectOption('CANADA','Canada'));
        options.add(new SelectOption('MEXICO','Mexico'));

        return options;
    public String[] getCountries() {
        return countries;
    public void setCountries(String[] countries) {
        this.countries = countries;


Attribute Name Attribute Type Description Required? API Version Access
id String An identifier that allows the selectOptions component to be referenced by other components in the page. 10.0 global
rendered Boolean A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 10.0 global
value Object A merge field that references the controller class collection variable of type SelectItem that is associated with this selectOptions component. For example, if the name of the associated variable in the controller class is mySetOfOptions, use value="{!mySetOfOptions}" to reference the variable. Yes 10.0 global