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
Chandra babu 2Chandra babu 2 

How to ADD the piclist Value?

pls anyone Help.

i am creted custom picklist on  UI page values there apple, banana,orange,
     Now my questios is i am giving  input test box another value like water million. 
                       water million is add the custom to write the code in vf page.pls help me.
Amit Chaudhary 8Amit Chaudhary 8
I hope you are using below code to create custom picklist value

       List<SelectOption> options = new List<SelectOption>();
       options.add(new SelectOption('apple', 'apple'));
       options.add(new SelectOption('banana', 'banana'));

Then you can create new function add to add new value like below

public pageReference addNewValue()
       options.add(new SelectOption('million', 'million'));
       return null;

Please let us know if this will help u
Amol SableAmol Sable
Use <apex:selectCheckboxes value="{!countries}" title="Choose a country"> <apex:selectOptions value="{!items}"/> </apex:selectCheckboxes> then you can add values dynamicallay in "items" list in controller.
Chandra babu 2Chandra babu 2
thanq sable