Wednesday, December 26, 2012

Rich Visualforce Editor Updates

Hi Guys, I am happy to announce new version of Rich Visualforce Plugin. I have added some exciting features to this release. The major change is you can use it with standalone version of IDE.

Major features of this release:-

  • GIT Integration (it helps you to push your code to git repository on Ctrl+S key press.)
  • Added support for new visualforce tags.
  • Plugin works well with both IDE as well as eclipse plugins.

GIT Integration IDE/Plugin never supported code versioning and many times I felt its necessity and added a new feature to this release. Now you can configure your project with GIT repository and this plugin provides git push on save event of apex page and class.

Added new visualforce tags support
Now plugin supports visulaforce tags introduced till 26 version of the API

Friday, December 14, 2012

Code snippet for salesforce multiselect picklist

Salesforce Multiselect Picklist

Hi Guys, we generally use multiselect picklist in salesforce here is an example of multiselect picklist.. which allows to show fields based on selected options.

see running example on 

<apex:page controller="MultiselectExample">
  <!-- Begin Default Content REMOVE THIS -->
  <apex:form id="form">
  <div style="border:1px solid gray;width:100%;float:left;">
    <div style="border:1px solid gray;width:50%;float:left;">
        <apex:panelGrid columns="3" id="multipicklistbox">
            <apex:selectList id="sel1" value="{!leftselected}" multiselect="true" style="width:200px" size="8">
                <apex:selectOptions value="{!leftBoxValues}" />
                <apex:panelGroup >
                    <apex:commandButton value=">" action="{!addtoLeftBox}" reRender="form" title="Select Objects"/>
                    <apex:commandButton value="<" action="{!addtoRightBox}" reRender="form" title="Deselect Objects"/>
            <apex:selectList id="sel2" value="{!rightselected}" multiselect="true" style="width:200px" size="8">
                <apex:selectOptions value="{!rightBoxValues}" />
         <apex:inputText id="other" label="Other Text" rendered="{!IsOtherOptionSelected}"/>
    <div style="border:1px solid gray;width:48%;float:left;">
    <apex:outputPanel id="selectedItems">
    <apex:commandButton value="Print Selected" reRender="selectedItems"/>

---------- MultiSelectExample.cls------------------

public class MultiselectExample {
    Public List<string> leftSelected{get;set;}
    Public List<string> rightSelected{get;set;}
    Set<string> leftValues = new Set<string>();
    Set<string> rightValues = new Set<string>();
    Set<string> selectedObjects = new Set<string>();
    public MultiselectExample(){
        for(integer i=0;i<10;i++){
            leftValues.add('selectList Item '+i);
        leftValues.add('Other Value');
    /* Add item to rightbox of picklist*/
    public PageReference addtoLeftBox(){
        for(String s : leftSelected){
        return null;
    /* Add item to leftbox of picklist*/
    public PageReference addtoRightBox(){
        for(String s : rightSelected){
        return null;

        /* return rightbox values of picklist */
    public List<SelectOption> getLeftBoxValues(){
        List<SelectOption> options = new List<SelectOption>();
        List<string> tempList = new List<String>();
        for(string s : tempList)
            options.add(new SelectOption(s,s));
        return options;
        /* return leftbox values of picklist */
    public List<SelectOption> getRightBoxValues(){
        List<SelectOption> options1 = new List<SelectOption>();
        List<string> tempList = new List<String>();
        for(String s : tempList)
            options1.add(new SelectOption(s,s));
        return options1;
    public Boolean getIsOtherOptionSelected(){
        Boolean retValue = false;
        for(String selObj: rightValues ){
                return true;
        return retValue;
    public PageReference printSelectedValues(){
        return null;