You need to sign in to do that
Don't have an account?
MMuneee
Dependent picklist using Visualforce
I have a two picklist values.
1.Country 2.State
if i select the india then the state picklist shoud have states belongs to india.Like that Us also
Can Any one help me.If possible provide the code
Thanks
1.Country 2.State
if i select the india then the state picklist shoud have states belongs to india.Like that Us also
Can Any one help me.If possible provide the code
Thanks
Here is a sample.
First, define your Visulforce Page with the picklists.
You can see that it uses a custom controller and an event "onchange" on country list to change the content of the states list when you select a country. It looks like this : Then define the APEX Class ctlDepPickLst to populates the options depending on the selected country : Of course countries and states should come from corresponding objects.
That's all.
Hope this helps.
Fred
All Answers
Here is a sample.
First, define your Visulforce Page with the picklists.
You can see that it uses a custom controller and an event "onchange" on country list to change the content of the states list when you select a country. It looks like this : Then define the APEX Class ctlDepPickLst to populates the options depending on the selected country : Of course countries and states should come from corresponding objects.
That's all.
Hope this helps.
Fred
https://help.salesforce.com/apex/HTViewHelpDoc?id=admin_state_country_picklists_overview.htm&language=en_US
Then you just reference MailingStateCode and MailingCountryCode fields as <apex:inputFields> and it will render choices for you.
Seems a good solution if the problem is with countries and states, but if you have to deal with other relations of this kind (let's say states and towns, town and schools and so on), knowing how to code it can be usefull.
Regards,
Fred
It's Really Helpfull
Regards,
Soundar.