Short question: How can I recreate the SelectFitlerElement
or dual_select
using Visualforce elements and javascript?
Long question: I am trying to improve a Visualforce page that allows you to assign users to a campaign.
Currently, the code I inherited is using several private Salesforce javascript elements. For example a SelectFilterElement
. Created like this var dual_select_0Var = new SelectFilterElement(params);
This is not good, since the main.js file where the element is declared clearly states:
/*
* This code is for Internal Salesforce use only, and subject to change without notice.
* Customers shouldn't reference this file in any web pages.
*/
It is my task to rebuild these elements. We want the selection to happen just like on the Roles page in Salesforce with an available and selected list that users can be swapped between.
This is always referred to as a dual_select
in the component id.
We are currently trying to recreate that functionality using two standard selectList
apex elements, two standard commandButton
for the arrows, and Javascript to push the names back and forth.
I am a Visualforce, Apex rookie and it is much more difficult than anticipated. No problem with a bit o hard work, but I figure someone probably knows a better way to do this. I have googled, and searched the salesforce forums, and this site a lot, no dice.
Is there an easier way to recreate the SelectFitlerElement or dual_select using Visualforce elements and javascript?