Multi-select picklists are a useful tool in any business process. We have a Salesforce app which uses a bunch of multi-selects, and while we love the value it provides, SFDC renders multi-selects in such an ugly way!
Chosen arrives to save the day! Unfortunately Chosen needs a little help to force its way into our app. That is where you come in!
We need to have a function developed which can easily be inserted into existing Visualforce pages. This function will use Chosen to render the multi-select and needs to support a variety of options.
|All||Boolean||If True, the multi-select must include an "ALL" option as the first item in the picklist.|
|All Default||Boolean||Only required if All=TRUE. If All Default = TRUE, then when the page loads, the All selection should be pre-selected.|
|All Name||String||Not required. If All=TRUE, then this field string should be the display value of All in the multiselect picklist.|
|Picklist Values||Map||The picklist values will be a map which contain id, value. Id will be a SFDC ID, value will be a string. Display the value in the picklist, and when an option is selected in the picklist, it should pass along the id.|
Additional Info regarding ALL:
- If the All option is selected in the picklist, remove all other selected values and only display "All" as selected.
- If the All option is already selected and the user expands the list and selects another value then place the new value in selections and remove the All selection.
You must use Chosen to power the picklist: http://harvesthq.github.io/chosen/