You need to sign in to do that
Don't have an account?
Brandon Bridges 16
With good reason, How do I show white space (blank) instead of --none-- in a visualforce case picklist?
With good reason, How do I show white space (blank) instead of --none-- in a visualforce case picklist?
I have about 10 picklist fields. None are required and I want the ones that have no value to be blank white space instead of "--none--".
The reason for this is to keep my UI looking clean and readable.
Having 10 fields with a label and "--none--" beside each of them is very cumbersome. I'd much rather they just show blank.
I have about 10 picklist fields. None are required and I want the ones that have no value to be blank white space instead of "--none--".
The reason for this is to keep my UI looking clean and readable.
Having 10 fields with a label and "--none--" beside each of them is very cumbersome. I'd much rather they just show blank.
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('picklistvalue1','picklistvalue1'));
Create a common method to get the picklist vale and pass the fieldname as a parameter. PFB the sample code for
All Answers
Unforunately, there is not a straight forward way. You can try the below approach.
You need to create your own picklists:
1. Create List<SelectOption> in controller. One for each of the picklist.
2. Add the picklist values to the list variables. Refer:
http://salesforce.stackexchange.com/questions/4992/how-to-get-a-picklist-all-values-in-apex-controller
3. Use the list variables in visualforce page: Mark this as the solution, if it solves your problem.
Thanks
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('picklistvalue1','picklistvalue1'));
Create a common method to get the picklist vale and pass the fieldname as a parameter. PFB the sample code for