You need to sign in to do that
Don't have an account?
sapthagiri_186
Dependent Picklist to be shown in visualforce page
Hi all,
I have a requirement where there are two picklist (Region and City Names) in the same object. Upon selecting Region, its respective Cities must be seen in the City Names picklist and I have made these two as dependent picklist. Here, I am using a VF page and I am not able to achieve dependent picklist.
So, I need a help in here to get my issue solved.
Best Regards
HI
Try this code:-
<apex:page standardController="Account">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputField value="{!Account.Region__c}"/>
<apex:inputField value="{!Account.Cities__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
if you have the picklist dependent on object then you only need to show them up on visualforce page using inputfield, and it will work.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi Anil and Ankit,
In the object, I have defined these two picklists (Region__c & Cityt__c) as dependent ones.
I did try this already and here is what I had written:
<apex:pageBlockSectionItem >
<apex:outputLabel value="Regions" style="position:relative;left:-100px"/>
<apex:inputField value="{!LeadInfo.Region__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="City" style="position:relative;left:-60px"/>
<apex:inputField value="{!LeadInfo.City__c}"/>
</apex:pageBlockSectionItem>
/*Class*/
public Lead__c LeadInfo = new Lead__c();
public Lead__c getLeadInfo()
{
return LeadInfo;
}