function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PawelWPawelW 

How to make Picklist (Multi-Select)? Checkbox defaul select.

I would like to use Picklist (Multi-Select) in Salesforce way (unselected on left selected on right) with my own values on visualforce page. How to build this kind of list?

Second:
Now I have group of checkboxes with my values but can't find the way how to set few of them an already checked?
I have varible String selectedCheckedBoxes with contains names of options. How to combine this string with checkboxes?

Page checkbox:






Controller:
public List getItems() {
List options = new List();
options.add(new SelectOption('Automotive','Automotive'));
options.add(new SelectOption('Consumer & Retail','Consumer & Retail'));
options.add(new SelectOption('Technology','Technology'));
options.add(new SelectOption('Industrial','Industrial'));
options.add(new SelectOption('Health Care','Health Care'));
options.add(new SelectOption('Aerospace','Aerospace'));
options.add(new SelectOption('Publishing / Media','Publishing / Media'));
options.add(new SelectOption('Energy','Energy'));
options.add(new SelectOption('Other','Other'));
return options;
}

Message Edited by PawelW on 07-25-2008 03:21 AM
Ron HessRon Hess
can you repost your code using the SRC button to preserve the code, some of this was lost.

there is no native multi-select picklist component, this is a good idea for the idea exchange.  You can also use a mulit-select field on a custom or standard object, then use inputField on your page to draw that picklist.