+ Start a Discussion
aqeel ahmadaqeel ahmad 

creat a list of type selectoption in one method and use it another method??

Harish RamachandruniHarish Ramachandruni

1. getCountriesOptions  methode  is selection option 

2. show methode is returning SelectOptions .
public class customPickListInVFDemoController {


    public String country { get; set; }
    public customPickListInVFDemoController(){
        public List<SelectOption> show() {
        return getCountriesOptions();
    public List<SelectOption> getCountriesOptions() {
        List<SelectOption> countryOptions = new List<SelectOption>();
        countryOptions.add(new SelectOption('india','india'));
        countryOptions.add(new SelectOption('usa','usa'));
        countryOptions.add(new SelectOption('UK','UK'));

        countryOptions.add(new SelectOption('NA','NA'));

        countryOptions.add(new SelectOption('CA','CA'));

        return countryOptions;

Use above code any issues ask me .

Reagrds ,
aqeel ahmadaqeel ahmad
Thanks for ur quick response..
Harish RamachandruniHarish Ramachandruni
Hi ,

is it completed ?

aqeel ahmadaqeel ahmad
yes it is.