You need to sign in to do that
Don't have an account?
West415
Dynamic Label and Checkboxes underneath?
HI,
I'm working with a visualforce page and form and I wanted to display a list if U.S. States as just text with checkboxes underneath each state for the cities in that state.
So for example:
Nevada
- Reno
- Carson City
- Las Vegas
Colorado
- Denver
- Boulder
I have a custom object that stores customer records. In the address fields I store the city and state. I want to generate the output above using this data and have a checkbox rendered for each city.
Any ideas on how to do this using visualforce?
I'm working with a visualforce page and form and I wanted to display a list if U.S. States as just text with checkboxes underneath each state for the cities in that state.
So for example:
Nevada
- Reno
- Carson City
- Las Vegas
Colorado
- Denver
- Boulder
I have a custom object that stores customer records. In the address fields I store the city and state. I want to generate the output above using this data and have a checkbox rendered for each city.
Any ideas on how to do this using visualforce?
You should use apex:Repeat (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm) and you could achieve it.
Let me know is you face any issues.
Thanks
Shashikant
Example 1:- You can Try picklist for same as well. Please check below post
https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html
http://www.forcetree.com/2009/06/dynamically-add-values-to-picklist.html
Example 2:- you can create the warpper class for same.
https://developer.salesforce.com/page/Wrapper_Class
Please let us know if this will help you
Thanks
Amit Chaudhary