You need to sign in to do that
Don't have an account?
Megan Moody 10
Display list of selected multi select picklist items in VF page
I'd like to make the display of the selected multi select picklist items more visually friendly in my VF page. Selected values are displayed by dfault like "option 1; option 2; option 6". I'd like it to display in a vertical list like so:
option 1
option 2
option 6
This is only for display purposes. The user doesn't need to add or remove values from the picklist. Is there a way to do this in a VF page? Thanks!
option 1
option 2
option 6
This is only for display purposes. The user doesn't need to add or remove values from the picklist. Is there a way to do this in a VF page? Thanks!
The reason it is showing this way is because salesforce stores the picklist values like that only.
Now you can use following javascript to do it .
Make sure javascript is rendered AFTER HTML element so that ID is found.
Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
All Answers
Consider that I have created a custom picklist(Multi select) on account with name Multiselect__c
Then you can use below code to display the same on VF page.
Your URL shoul look like
SalesforceUrl/apex/PageName?ID=accountID
For me it is
https://c.eu5.visual.force.com/apex/MultiselectPickList?ID=00124000007wD7B
You van use below code to display same Let me know if you have any issue.
Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
I want the string to be parsed and displayed vertically like so:
option1
option2
option6
The reason it is showing this way is because salesforce stores the picklist values like that only.
Now you can use following javascript to do it .
Make sure javascript is rendered AFTER HTML element so that ID is found.
Donot forget to select best answer to make our efforts visible in the developer forum.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
Any update whether the code works for you or not.
Please select your answer so that our efforts are visible.