function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TLeahyTLeahy 

VF page as component in standard object layout, need "save' to only reload component

I have a vf page in a standard object, working the kinks out, my biggest obstacle is having the "save" button load just the VF component [page] and not the entire page. As is is now, the button loads the entire page within the iframe which initially holds just the vf page on the Lead page layout. How can i get the "Save" button within the VF page component to either save and reload the parent widow, or to only reload the component within its own iframe?

 

Here is the VF page code:

 

<apex:page standardController="Lead" rendered="true">

<style type="text/css">
.rowalt {
    background: #E1E9EA;
    margin: 0;
    padding: 0;
    border: 0px;
}
</style>

<apex:form >
            
<apex:pageBlock mode="inlineEdit" title="Warehousing" id="Warehousing">
<apex:pageBlockButtons >
    <apex:commandButton action="{!Save}" id="saveButton" value="Save"/>
    <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel"/>
</apex:pageBlockButtons>
<apex:inlineEditSupport showOnEdit="saveButton, cancelButton"  hideOnEdit="editButton" event="ondblclick"  

changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
        

                       
    <apex:pageBlockSection columns="1">
    
    <apex:pageBlockTable style="cellspacing: 0px; cellpadding: 0px;"  id="WarehousingLables" value="{!Lead}" var="L" 

columns="4" >
        <apex:column headerValue=" ">
        <tr>
            <td width="16%" align="right"><strong>Number: &nbsp;&nbsp;</strong></td>
            <td width="28%"><apex:outputField label="Number: " value="{!Lead.Number_Ws__c}"/></td>
            <td width="28%"><apex:outputField label="Number: " value="{!Lead.Number_Wd__c}"/></td>
            <td width="28%"><apex:outputField label="Number: " value="{!Lead.Number_Wm__c}"/></td>
            
        </tr>
        <tr class="rowalt">
            <td align="right"><strong>Locations - Cities: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="Locations (City): " value="{!Lead.Locations_City_Ws__c}"/></td>
            <td><apex:outputField label="Locations (City): " value="{!Lead.Locations_City_Wd__c}"/></td>
            <td><apex:outputField label="Locations (City): " value="{!Lead.Locations_City_Wm__c}"/></td>
            
        </tr>
        <tr>
            <td align="right"><strong>State: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField value="{!Lead.State_Ws__c}"/></td>
            <td><apex:outputField value="{!Lead.State_Wd__c}"/></td>
            <td><apex:outputField value="{!Lead.State_Wm__c}"/></td>
            
        </tr>
        <tr class="rowalt">
            <td align="right"><strong>Country: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="Country: " value="{!Lead.Country_Ws__c}"/></td>
            <td><apex:outputField label="Country: " value="{!Lead.Country_Wd__c}"/></td>
            <td><apex:outputField label="Country: " value="{!Lead.Country_Wm__c}"/></td>
            
        </tr>
        <tr>
            <td align="right"><strong>Square Feet: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="Square Feet: " value="{!Lead.Square_Feet_Ws__c}"/></td>
            <td><apex:outputField label="Square Feet: " value="{!Lead.Square_Feet_Wd__c}"/></td>
            <td><apex:outputField label="Square Feet: " value="{!Lead.Square_Feet_Wm__c}"/></td>
            
        </tr>
        <tr class="rowalt">
            <td align="right"><strong>EEs: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="EE's: " value="{!Lead.EEs_Ws__c}"/></td>
            <td><apex:outputField label="EE's: " value="{!Lead.EEs_Wd__c}"/></td>
            <td><apex:outputField label="EE's: " value="{!Lead.EEs_Wm__c}"/></td>
            
        </tr>
        <tr>
            <td align="right"><strong>Run By: &nbsp;&nbsp;</strong></td>
            <td><center>—</center></td>
            <td><apex:outputField label="Run By: " value="{!Lead.Run_By_Wd__c}"/></td>
            <td><apex:outputField label="Run By: " value="{!Lead.Run_By_Wm__c}"/></td>
            
        </tr>
        <tr class="rowalt">
            <td align="right"><strong>Contract Structure: &nbsp;&nbsp;</strong></td>
            <td><center>—</center></td>
            <td><apex:outputField label="Contract Structure: " value="{!Lead.Contract_Structure_Wd__c}"/></td>
            <td><apex:outputField label="Contract Structure: " value="{!Lead.Contract_Structure_Wm__c}"/></td>
            
        </tr>
        <tr>
            <td align="right"><strong>Exp. Date: &nbsp;&nbsp;</strong></td>
            <td><center>—</center></td>
            <td><apex:outputField label="Exp. Date: " value="{!Lead.Exp_Date_Wd__c}"/></td>
            <td><apex:outputField label="Exp. Date: " value="{!Lead.Exp_Date_Wm__c}"/></td>
            
        </tr>
        <tr class="rowalt">
            <td align="right"><strong>Lease Owner: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="Lease Owner: " value="{!Lead.Lease_Owner_ws__c}"/></td>
            <td><apex:outputField label="Lease Owner: " value="{!Lead.Lease_Owner_Wd__c}"/></td>
            <td><center>—</center></td>
            
        </tr>
        <tr>
            <td align="right"><strong>Lease Exp. Date: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="Lease Exp. Date: " value="{!Lead.Lease_Exp_Date_Ws__c}"/></td>
            <td><apex:outputField label="Lease Exp. Date: " value="{!Lead.Lease_Exp_Date_Wd__c}"/></td>
            <td><center>—</center></td>
            
        </tr>
        <tr class="rowalt">
            <td align="right"><strong>WMS: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="WMS: " value="{!Lead.WMS_Ws__c}"/></td>
            <td><apex:outputField label="WMS: " value="{!Lead.WMS_Wd__c}"/></td>
            <td><apex:outputField label="WMS: " value="{!Lead.WMS_Wm__c}"/></td>
            
        </tr>
        <tr>
            <td align="right"><strong>ERP: &nbsp;&nbsp;</strong></td>
            <td><apex:outputField label="ERP: " value="{!Lead.ERP_Ws__c}"/></td>
            <td><apex:outputField label="ERP: " value="{!Lead.ERP_Wd__c}"/></td>
            <td><apex:outputField label="ERP: " value="{!Lead.ERP_Wm__c}"/></td>
            
        </tr>
        </apex:column>
        <apex:column headerValue="Self-Managed" >
        </apex:column>
        <apex:column headerValue="Dedicated">
        </apex:column>
        <apex:column headerValue="Multi-Client">
        </apex:column>
        <apex:column >
        </apex:column>

    </apex:pageBlockTable>

</apex:pageblocksection>
</apex:pageBlock>
</apex:form>

</apex:page>

 

Starz26Starz26

This should refresh the parent window after the save action is complete

 

for the commandbutton,

 

try adding:

 

oncomplete="window.parent.location = '/{!Lead.id}'"
TLeahyTLeahy

I added that to the save command button, it did not seem to have any affect, it still loads the entire lead page within the section where the vf page was added on the lead page [so i have the same lead reflecting within itself - header and all]