I have a functionality which uses Apex and VisualForce to create a multi-select picklist of record Names which is an ad-hoc list created by a query. The user can select multiple Names - and an Apex trigger will create a child record to the current record for each of the selections.
I use a VisualForce page to display the whole record. Here is an example of the VF page :
<apex:page standardcontroller="Breach__c" extensions="BreachVFControllerEdit">
<apex:messages />
<apex:sectionheader title="{!$ObjectType.Breach__c.label} Edit" subtitle="{!IF(ISNULL(Breach__c.Name), 'New Breach',Breach__c.Name)}"/>
<apex:form >
<apex:pageblock mode="edit" title="{!$ObjectType.Breach__c.label} Edit">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!Save}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockbuttons>
<!-- ********** [Record Type : Master ] ********** -->
<apex:outputpanel >
<apex:pageblocksection title="Information" showheader="true" columns="1">
<apex:outputfield value="{!Breach__c.Name}"/>
<apex:inputfield value="{!Breach__c.Description__c}" required="false"/>
<apex:inputfield value="{!Breach__c.Date_of_Breach__c}" required="false"/>
</apex:pageblocksection>
</apex:outputpanel>
<!--BEGINNING OF MULTISELECT PIECE-->
<apex:outputpanel id="SubsidiariesDetails2">
<apex:pageblocksection title="Products Affected By Breach" columns="1">
<apex:inputfield value="{!Breach__c.Vendor_Profile__c}" required="false" >
<apex:actionSupport event="onchange" action="{!execute}"
rerender="SubsidiariesDetails2,Subsidiaries" immediate="false" />
</apex:inputfield>
<apex:pageBlockSectionItem id="selPanel">
<c:MultiselectPicklist leftLabel="Available Products"
leftboxatt="{!items}"
rightLabel="Selected Products"
rightboxatt="{!selectedSubs2}"
size="5"
width="200px"/>
<apex:inputfield value="{!Breach__c.Product_Included__c}" rendered="false" required="false"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputpanel>
<!--END OF MULTISELECT PIECE-->
</apex:pageblock>
</apex:form>
</apex:page>
The only part that is relevant to this functionality is the section between <!...BEGINNING OF MULTISELECT PIECE>
and <!--END OF MULTISELECT PIECE-->
.
What I would like to know is if it is possible to use that section as an embedded Visual Force page within a Page Layout instead of overriding the entire Edit of the object with the whole VisualForce page. Is it possible ? How do I name the extension="BreachVFControllerEdit"
at ?
I didn't include the Apex or the VisualForce component ("MultiselectPicklist") used by the page because I didn't want to make this any more confusing than I need but I can do that if needed.