You need to sign in to do that
Don't have an account?
sagarrrr
Create a Visual Force page. This page should display two picklists, one for Country and another for City. Initially city picklist should not display any value; instead it should be dependent upon Country picklist. So when user selects a pa rtic
Create a list custom setting named “Country”. Create four records of this custom setting:
1. Name = India
2. Name = France
3. Name = Italy
4. Name = USA
Create another list custom setting named “City”. Add a field “Country” of data type text on this
custom setting.
Create following records of this custom setting:
1. Name = New Delhi, Country = India
2. Name = Mumbai, Country = India
3. Name = Pu ne, Country = India
4. Name = Kolkata, Country = India
5. Name = Ney York, Country = USA
6. Name = Miami, Country = USA
7. Name = Washington DC, Country = USA
8. Name = Paris, Country = France
9. Name = Lyon, Country = France
10. Name = Milan, Country = Italy
11. Name = Rome, Country = Italy
Create a Visual Force page. This page should display two picklists, one for Country and another for City. Initially city picklist should not display any value; instead, it should be dependent upon Country picklist. So when the user selects a particular country then City picklist should load all the cities corresponding to the selected country.
plz help in this question i have created 2 custom setting name as city and country but i am stuck in vf page plz any one help me
thank you
1. Name = India
2. Name = France
3. Name = Italy
4. Name = USA
Create another list custom setting named “City”. Add a field “Country” of data type text on this
custom setting.
Create following records of this custom setting:
1. Name = New Delhi, Country = India
2. Name = Mumbai, Country = India
3. Name = Pu ne, Country = India
4. Name = Kolkata, Country = India
5. Name = Ney York, Country = USA
6. Name = Miami, Country = USA
7. Name = Washington DC, Country = USA
8. Name = Paris, Country = France
9. Name = Lyon, Country = France
10. Name = Milan, Country = Italy
11. Name = Rome, Country = Italy
Create a Visual Force page. This page should display two picklists, one for Country and another for City. Initially city picklist should not display any value; instead, it should be dependent upon Country picklist. So when the user selects a particular country then City picklist should load all the cities corresponding to the selected country.
plz help in this question i have created 2 custom setting name as city and country but i am stuck in vf page plz any one help me
thank you
you can use dependent pick list
for more info https://success.salesforce.com/answers?id=90630000000hXlTAAU
If you have these picklist on an Object then you can go for Dependent Picklist else You have to controll the same on Visualforce Page and its contoller.
Simplest way to do so, create a Map of map<String , List<String>>. Like:
Show the 1st picklist as Key of map and the 2nd picklist will pay along with values of the Key.
You can also try custom setting to be more dynamic, store all the values in custom setting and add those in the map and show it in Visualforce Page.
i want to complete this question with help of custom setting.
thank you
I want to complete this question with the help of a custom setting. And i have created the vf Page for this but I am stuck in Apex Class.
So Can you help me apex class.
VF CODE-
<apex:page controller="c10">
<apex:form >
<apex:actionFunction name="rerenderCity" rerender="statesSelectList" >
<apex:param name="firstParam" assignTo="{!country}" value="" />
</apex:actionFunction>
<table><tbody>
<tr>
<th>Country</th>
<td>
<apex:selectList id="country" styleclass="std" size="1"
value="{!country}" onChange="rerenderCity(this.value)">
<apex:selectOptions value="{!countriesSelectList}"/>
</apex:selectList>
</td>
</tr>
<tr id="city_input">
<th>City</th>
<td>
<apex:selectList id="citySelectList" styleclass="std" size="1"
value="{!city}">
<apex:selectOptions value="{!citySelectList}"/>
</apex:selectList>
</td>
</tr>
</tbody></table>
</apex:form>
</apex:page>
I have already created two custom settings with the name Country and City.
This can be done by single custom setting Name the records of custom setting as Country name and its field as City's.
In the class you have to create the map like:
Once its done the same map can be used in the Visualforce page.
Let me know if it helps!!!!
But the requirement is different. So can you help me !!
Thank you