You need to sign in to do that
Don't have an account?
sylar20
Dependent field in VisualForce
Hi,
I have configured a field dependency in my Case Object, but when i put in my VF page it doesn't work the way it does in the standard page layout. Both the fields show all picklist values. No dependency is working.
Following is my VF code to include those two fields in the VF page.
Controlling Field: Department
Dependent Field : Case Reason
<apex:inputField required="true" value="{!Case.Department__c}"/> <apex:inputField required="true" value="{!Case.Case_Reason2__c}">
Interesting!
I do not see anything wrong with the code. Its working for me! The same code.
I am assuming your VF page version is 21.0 and you have correctly configured the dependent picklists.
From a standard UI were you able to access the controlling and dependent fields correctly?
Sales4ce
All Answers
I don't see anything wrong with the code posted except that the second Input Field tag should be closed. Your page should render the dependent picklists without any issues.
I might be curious to know the Visual Force Page Version.
Let me know if was some help.
Thanks,
Sales4ce
In one of my requirements i have used the field dependencies in the visualforce page and it worked fine for me. The version of my page was 19.0 and i used on that same Case object.
Try removing "required=true".
<apex:inputField value="{!Case.Department__c}"/>
<apex:inputField value="{!Case.Case_Reason2__c}"/>
I have already tried removing required=true.. Still it doesn't work.
Will troubleshoot again and update..
Thanks
Are you using standard controller or custom controller?
Can you post the complete code including VF page and any customer controller, if there is one to better help you with the issue.
Sales4ce
HI,
I am using the standard controller Case.
Following is my VF Page Code:
Interesting!
I do not see anything wrong with the code. Its working for me! The same code.
I am assuming your VF page version is 21.0 and you have correctly configured the dependent picklists.
From a standard UI were you able to access the controlling and dependent fields correctly?
Sales4ce
Ahhhhhrg.. It was the API 15 which i have selected.
Its 21.0 now. Thanks salse4ce