+ 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.