You need to sign in to do that
Don't have an account?
display multiselect on selection of dependent picklist in visualforce page
Hi All,
I have a requrirement where
1. I have an object O1 and fields like Name, F1, F2, F3 are as dependent picklist. F2 is dependent in F1 and F3 is dependent on F2.
2. I want to display all the Names in a multiselect list when F1, F2, F3 is selected.
Now I am only displaying all the picklist in vf page. Need help in displaying name as multiselect list .
Below is the code i am trying to do -
Apex Class -
public with sharing class soption{
public List<MSA__C> records{get;set;}
public MSA__c objAct{get;set;}
public soption(ApexPages.StandardController controller) {
objAct = new MSA__C();
}
public pagereference search()
{
records=[Select ID,Name,Coe__c,Dept__c,OpCo__c from MSA__C where Coe__c=: objAct.Coe__c and Dept__c=: objAct.Dept__c];
return null;
}
}
Vf Page -
<apex:page standardController="MSA__c" extensions="soption" sidebar="false">
<apex:messages style="color:red"></apex:messages>
<apex:form id="theform">
<apex:pageblock mode="edit">
<apex:pageblockSection >
<apex:inputfield value="{!objAct.Coe__c}" />
<apex:inputfield value="{!objAct.Dept__c}" />
<apex:inputfield value="{!objAct.OpCo__c }" />
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>
Regards
I have a requrirement where
1. I have an object O1 and fields like Name, F1, F2, F3 are as dependent picklist. F2 is dependent in F1 and F3 is dependent on F2.
2. I want to display all the Names in a multiselect list when F1, F2, F3 is selected.
Now I am only displaying all the picklist in vf page. Need help in displaying name as multiselect list .
Below is the code i am trying to do -
Apex Class -
public with sharing class soption{
public List<MSA__C> records{get;set;}
public MSA__c objAct{get;set;}
public soption(ApexPages.StandardController controller) {
objAct = new MSA__C();
}
public pagereference search()
{
records=[Select ID,Name,Coe__c,Dept__c,OpCo__c from MSA__C where Coe__c=: objAct.Coe__c and Dept__c=: objAct.Dept__c];
return null;
}
}
Vf Page -
<apex:page standardController="MSA__c" extensions="soption" sidebar="false">
<apex:messages style="color:red"></apex:messages>
<apex:form id="theform">
<apex:pageblock mode="edit">
<apex:pageblockSection >
<apex:inputfield value="{!objAct.Coe__c}" />
<apex:inputfield value="{!objAct.Dept__c}" />
<apex:inputfield value="{!objAct.OpCo__c }" />
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>
Regards
https://www.sundoginteractive.com/sunblog/posts/displaying-dependent-picklist-fields-on-a-visualforce-page
Please select this answer is useful you
I am not actually getting your question but if you want to make a dependent picklist than you can take help from the below link
http://www.infallibletechie.com/2012/10/dependent-picklist-using-apex-in.html