You need to sign in to do that
Don't have an account?

Calling generic methods for different object of same type.
Hi,
I wanted something like this in my code

I got this using single controller with few methods and and one visualforce page.
Now what I want is :

But I want to use single controller which will operate on different lists.
So planning to have somethink like this
1) 1 Visual force
2) controller A has got different objects like multiselect1, multiselect2 and multiselect3 (These 3 objects are of type multiselect)
3) one generic controller/class 'multiselect' which will store information related to data in left panel, right panel, selected and unselected and some functions to move data from one panel to another. I can call these methods from controller A by calling methods using specific objects (like we do in Java).
How I can make this work?
So basically, what I want is visualforce page calls methods on particular object which will get pass to controller A and controller A will again call method from multiselect class on the same object passed by visualforcepage.
Current visualforcepage code :
Please let me know if my question is confusing.
Best Regards,
Abhishek
I wanted something like this in my code
I got this using single controller with few methods and and one visualforce page.
Now what I want is :
But I want to use single controller which will operate on different lists.
So planning to have somethink like this
1) 1 Visual force
2) controller A has got different objects like multiselect1, multiselect2 and multiselect3 (These 3 objects are of type multiselect)
3) one generic controller/class 'multiselect' which will store information related to data in left panel, right panel, selected and unselected and some functions to move data from one panel to another. I can call these methods from controller A by calling methods using specific objects (like we do in Java).
How I can make this work?
So basically, what I want is visualforce page calls methods on particular object which will get pass to controller A and controller A will again call method from multiselect class on the same object passed by visualforcepage.
Current visualforcepage code :
<apex:panelGrid columns="3" id="abcd"> <apex:selectList id="sel1" value="{!leftselected}" multiselect="true" style="width:100px" size="5"> <apex:selectOptions value="{!unselectedvalues}" /> </apex:selectList> <apex:panelGroup > <br/> <apex:image value="{!$Resource.moveRight}"> <apex:actionSupport event="onclick" action="{!selectclick}" reRender="abcd"/> </apex:image> <br/><br/> <apex:image value="{!$Resource.moveLeft}"> <apex:actionSupport event="onclick" action="{!unselectclick}" reRender="abcd"/> </apex:image> </apex:panelGroup> <apex:selectList id="sel2" value="{!rightselected}" multiselect="true" style="width:100px" size="5"> <apex:selectOptions value="{!SelectedValues}" /> </apex:selectList> </apex:panelGrid>
Please let me know if my question is confusing.
Best Regards,
Abhishek
All Answers
For multi-select picklist there no need to use such type of complx approach is required. This functionlity can be acheived by <apex:selectlist> and two <apex:commandbutton>. Bind an action function with commandbuttons and rerender the list.