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
V100V100 

Multislect picklist using in Apex

Have a visualforce page with a multi select picklist.

<apex:selectList value="{!selectedGroups}" size="10" multiselect="true">

 

I then need to loop over the comma delimited output selectedGroups in apex but i am not sure how to go about this.

Any suggestions?

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
rohitrrohitr

You can put the values into a list. and the work over the list.

 

List<String> picklistList = new List<String>();
         pickValues += ',';
        picklistList= pickValues.split(',');

 

All Answers

rohitrrohitr

You can put the values into a list. and the work over the list.

 

List<String> picklistList = new List<String>();
         pickValues += ',';
        picklistList= pickValues.split(',');

 

This was selected as the best answer
V100V100

Brilliant thanks