Activity › Forums › Salesforce® Discussions › What is the difference between apex:selectOption and apex:selectList?
Tagged: apex:selectList, apex:selectOption, Salesforce Apex Class, Salesforce Apex Code, Salesforce Apex Function
-
What is the difference between apex:selectOption and apex:selectList?
Posted by kapil on March 15, 2018 at 12:47 PMWhat is the difference between apex:selectOption and apex:selectList?
Archit replied 8 years, 2 months ago 3 Members · 2 Replies -
2 Replies
-
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.
- [adinserter block='9']
-
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}/>
<apex:selectOption value={!value2}/>
<apex:selectOption value={!value3}/>
</apex:selectList>Hope This Would be Helpful!!
Log In to reply.