Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I want to build a visualforce interface that allows me to display a list of available things on the left, and chosen things on the right? This one is hard to explain, so I've made an screen shot, because this is a user interface that salesforce itself uses.

multi-select picklist http://i.imgur.com/52pZo.png

Any ideas on how to go about this?

share|improve this question
Are you referring to dynamic visualforce bindings? – Nick Cook Sep 8 '12 at 4:43
When asking questions in the future please make sure the title contains some level of detail about what you're asking. "How do I build" is not a complete question. – ca_peterson Sep 8 '12 at 6:01

3 Answers

up vote 10 down vote accepted

Have you seen this blog post by Pat Patterson?

It should give you exactly what you're looking for.

http://blogs.developerforce.com/developer-relations/2012/06/a-multiselect-picklist-visualforce-component.html

share|improve this answer
This is Exactly what I was looking for! Thank you so much! – Kevin P Sep 8 '12 at 14:20

If your field type is Multi-Select then you can just use the apex:inputField tag and you get the Multi-Select functionality for free. I would look at using that first.

For example, in a page that uses a standardController you would have something like:

<apex:inputField value="{!My_Object__c.My_Multi_Select_Field__c}"/>

However, if that is not enough then I'd try using/adapting the component referenced by Mikey. There's also an example in the Visualforce Developer's guide in the section on Dynamic Visualforce Components. While you might not be using Dynamic Visualforce Components, you could still use the general pattern of the multiselect in the example.

share|improve this answer

The blog post by Pat Patterson is by far the best one around but if you have limitations (can't use Javascript, for instance) then there is an example in the Visualforce documentation that I have used a bit: Using Dynamic References for a User-Customizable Page http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#CSHID=pages_dynamic_vf_components_intro.htm|StartTopic=Content%2Fpages_dynamic_vf_components_intro.htm|SkinName=webhelp Adapt the "Select Fields to Display" PageBlock

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.