Activity Forums Salesforce® Discussions What is the difference between apex:selectOption and apex:selectList?

  • PRANAV

    Member
    March 15, 2018 at 1:54 pm

    Hi Kapil,

    apex:selectOption

    A possible value for an <apex:selectCheckboxes> or <apex:selectList> component. The <apex:selectOption>component must be a child of one of those components.

    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 to the generated <option> tag for components within an <apex:selectList> parent component.

    apex:selectList

    A list of options that allows users to select only one value or multiple values at a time, depending on the value of its multiselect attribute.

    This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated <select> tag.

    Hope this helps you.

     

  • Archit

    Member
    March 16, 2018 at 10:20 am

    Hello Kapil,

    <apex:SelectOptions> reflects a plural term, which says that we can configure multiple options in the list of choice options by calling directly a list of value by using single line of code.

    Example :

    <apex:selectOptions value={!ListofValues}/>

    ListofValues is the list that contains content.

    <apex:selectList > allows you to provide choice options as per your choice or putting upon separate values in picklist.

    Example :

    <apex:selectList >
    <apex:selectOption value={!value1}/> <!--if you are putting it as a separate values -->
    <apex:selectOption value={!value2}/>
    <apex:selectOption value={!value3}/>
    </apex:selectList>

    Hope This Would be Helpful!!

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos