function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alferd NealAlferd Neal 

Dynamic dependent picklist

Hello Hi...

 

             I have created a dynamic picklist using VF page and apex class but can we use this functionality to make dependent picklist so that a client can add to the picklist with ease.. And thanks in advance for any help which you people can give me...

Pradeep_NavatarPradeep_Navatar

You need to use VF action tags, add the below action tag to the first picklist in your VF page :

 

<apex:actionSupport event="onSelect" action="{!actionMethod in your controller}" rerender="component id of your second picklist" />         

 

place this code within <apex:selectList> tag(for first picklist), in action property you need to give a controller method name that will be executed after you select a value from first picklist and in rerender property you need to give the id of second picklist which will be rendered.

 

Hope this helps.

anil 007anil 007

Hii,

 

Try this one.

 

 product:<apex:select List size="1" value="{!p2}" id="theProdTable2">
                     <apex:selectOptions value="{!BillingDateList1}"></apex:selectOptions>
                   <apex:actionSupport event="onchange"  action="{!setProdName}" reRender="theItemTable2" />
               </apex:selectList>


               Item:<apex:selectList size="1" value="{!i2}" id="theItemTable2">
                   <apex:selectOptions value="{!ItemList1}"></apex:selectOptions>
                   
               </apex:selectList>