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
aqeel ahmadaqeel ahmad 

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

Harish RamachandruniHarish Ramachandruni
Hi,



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 ,
Harish.R.
 
aqeel ahmadaqeel ahmad
Thanks for ur quick response..
Harish RamachandruniHarish Ramachandruni
Hi ,


is it completed ?


Regards,
harish.r.
aqeel ahmadaqeel ahmad
yes it is.