Created
April 2, 2014 17:42
-
-
Save kiran-machhewar/9939157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page standardController="Opportunity"> | |
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/> | |
<apex:form > | |
<apex:pageMessages id="pageMessages"/> | |
<apex:pageBlock title="Custom Picklist Demo"> | |
<apex:pageBlockSection > | |
<apex:repeat value="{!$ObjectType.Opportunity.Fieldsets.PicklistDemoFields}" var="field"> | |
<apex:inputField value="{!opportunity[field]}" rendered="{!$ObjectTYpe.Opportunity.fields[field].Type!='reference'}"/> | |
<apex:pageBlockSectionItem rendered="{!$ObjectTYpe.Opportunity.fields[field].Type=='reference'}" > | |
<apex:outputLabel value="{!$ObjectType.Opportunity.fields[field].Label}"/> | |
<c:Picklist id="name" style="width:50%" required="{!OR(field.required, field.dbrequired)}" | |
labelField="Name" valueField="Id" objectName="{!$ObjectType.Opportunity.fields[field].ReferenceTo[0]}" | |
value="{!opportunity[field]}" | |
filterFields="{!IF(field='Contact__c','AccountId','')}" | |
filterValues="{!IF(field='Contact__c','.AccountId','')}" | |
styleClass="{!field}"></c:Picklist> | |
</apex:pageBlockSectionItem> | |
</apex:repeat> | |
</apex:pageBlockSection> | |
<center> | |
<apex:commandButton action="{!save}" reRender="pageMessages" value="Save Opportunity"/> | |
</center> | |
</apex:pageBlock> | |
</apex:form> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment