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
vishwa attikerivishwa attikeri 

Need help on Multi select picklist

Hi, 

 

Need help on below Issue,

 

How to display multiselect picklist value one by one instead of semicomma (;)

 

for example;

 

Item1;item2;item3;item4;item5  instead of this i need 

 

Item1

item2

item3

item4

item5  

 

is it poosible...?,

and i am using standard controller in visualforce page

AravindBabu512AravindBabu512

Hi,

 

I am afraid you cant do this by just a standard controller. You need to have a funtion to parse the value to format that you require. Here is an example that you can refer to Parse a CSV with APEX , this can be a good document for you to start with. The parse funtion part can help you in this requirement.

 

Thanks,

Aravind

vriavmvriavm

Try replacing comma/semicolon with <br> tag and display the controller variable in outputtext with escape="false"

vishwa attikerivishwa attikeri

Hi Vriavm,

thanks for you replay,

here iam using outputfield its come from object

 

for ex: <apex:outputfield value="{!object.field__c}"/> 

 

where i have to use <br> here

Gunners_23Gunners_23

If you want show all those values in a seperate then you have to go for Extension and in there get the fields values and assign it to String List or array by splitting it based on ';' . Please refer http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_string.htm for string methods

 

Once you got the array of values then in the page you can use apex:repeat and apex:outputText for displaying the values in page

vriavmvriavm

Hi,

 

     In the controller create a new string variable like getter setter

     Controller:

     public String pickval { get;set; }

     picval = <picklist field>.replace(';','<br>');

   

     VF page :

      <apex:outputtext escape="false" value="{!picval}"/>