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
lakshman.mattilakshman.matti 

Picklist + custom settings

HI All,

I have a page which contains many fields out which 2 are region and country,these 2 are picklists.
i wanted to populate values into these 2 fields from custom settings. problem is i wanted to country values based region values.
Ex: say i have region like APJ,EMEA.
for APJ i have countries like india,indonesia,australia,
for EMEA i have countries like US,UK,.
when i select REgion as APJ i have to show only india,indonesia,australia in the country field.
for this do i need to create 2 custom settings ?and how to achieve the above functionality in VF Page.

Thanks
Lakshminarayana
 
@Karanraj@Karanraj
You can dynamically add the value to the picklist in the controller class
List<SelectOption> options = new List<SelectOption>();
  options.add(new SelectOption('APJ', 'APJ');

Set the onchange event in the region picklist and rerender the country picklist.
Set the if condition while adding the options for country picklist like below
if(Region = 'APJ')
  options.add(new SelectOption(India, EMEA));
  //Add other apj regions
else if (Region = 'EMEA')
  //Add EMEA regions


  
lakshman.mattilakshman.matti
HI Karanraj,

Thanks for the reply. i have a doubt in ur answer. is rerender attribute available in selectlist.how can i rerender country picklist.
can u post full vf page code and controller.

Thanks
Lakshman