function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDCRKSFDCRK 

selectList as selectPickList?? dynamic picklist

Hi,
I am trying to create a dynamic pick-list values and populate the selectList component, is there a way to show the component as pick-list view instead of list view?
 
OR
 
Basically what I am trying to do create a dynamic pick-list field but looping thru the a table (ratecard).
 
Any help is greatly appreciated.
 
Thanks,
rk
ptamkptamk

<!-- Setting the size to 1 will change the list to a drop down -->

<apex:selectList value="{!countries}" size="1" required="true" id="cbo_selectValue">

<apex:selectOptions value="{!items}" />

</apex:selectList>

</apex:pageBlockSectionItem>

//controller

public String[] countries {get; public set; }

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;

}