Is it possible, and what would be the approach, to create an apex:commandButton which displays a dropdown when clicked, in the same fashion as the Manage Members button on the Campaign object:

enter image description here

I'm comfortable with writing the logic behind the button but it's the actual display I'm not sure how to start. Is there a Salesforce native way of doing this or should I be looking at something javascript/jQuery?

To clarify the dropdown list I would list to be dynamic. I've just been looking at this approach, and it works BUT I need the drop down/apex:commandLinks to be dynamically generated: http://www.tehnrd.com/custom-multi-select-buttons/

More detail:

I want to add a button to a custom product entry screen which will add a group of Products as OpportunityLineItems, however the Products are categorised by year and the choice will be one of the years or all of them (not a mixture of years).

Just found an idea for it: https://success.salesforce.com/ideaview?id=08730000000BqRhAAK


I think there is no Visualforce element that can do this.

You can use semantic-ui dropdown that looks like have a specification with what you looking for.

|improve this answer|||||
  • Thanks that looks interesting but I wasn't clear in my question. The drop down ideally needs to be dynamically generated I'm not sure how I would do that with this approach? – Girbot Nov 14 '14 at 16:58
  • you can create SelectList and SelectOptions dynamically. here the example : salesforce.com/us/developer/docs/pages/Content/… – arufian Nov 21 '14 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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