I have a VF page which uses a custom controller SearchController
.
The VF page a has component TempCmp
.
In the component TempCmp
, I am trying to use dependent picklists using apex:inputField
.
It throws the following error:
The dependent picklist 'Dependent Pick List' requires its controlling field 'Controlling Pick list 1' to be present on the page.
VF page
<apex:page controller="SearchController">
This is page
<c:TempCmp leadVariable="{!patient}"></c:TempCmp>
</apex:page>
Custom Controller:
global with sharing class SearchController {
public Lead patient {get; set;}
}
Component:
<apex:component >
<apex:attribute name="leadVariable" description="Object Variable" type="Lead" />
<apex:form >
<apex:pageBlock>
<apex:inputField value="{!leadVariable.Controlling_Pick_list_1__c}"/>
<apex:inputField value="{!leadVariable.Dependent_Pick_List__c}"/>
</apex:pageBlock>
</apex:form>
</apex:component>
Is there any way to resolve this issue using VF component?