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
Sonya Dhand 3Sonya Dhand 3 

VisualForce page not refreshing correctly

Hi Community

I have a VF page section on a standard page for a custom object and when I edit and save some fields the section will refresh as expected by returning back to the VF page.  However some field will refresh and then display the home page and standard desktop view of the whole standard page within the vf section as below
User-added image

I have attached my code as well, I would appreciate any help? :)
 
<apex:page standardController="Employee__c">
<apex:form >
<apex:pageMessages />
<apex:pageBlock mode="inlineEdit" id="all"  >
<apex:actionFunction action="{! save }" name="saveChanges" reRender="all" oncomplete="location.reload()"/>
<apex:pageBlockButtons >

           


                <apex:commandButton id="saveButton" value="Save" onclick="saveChanges()"/>

                 <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" immediate="true"/> 

            </apex:pageBlockButtons>

    <style>
          
           body .bPageBlock .pbBody .grey .pbSubheader{
               background-color:#fbf8f8;
          
           }
            body .bPageBlock .pbBody .grey .pbSubheader h3{
               color:#000;
           }
           
       </style>
       <apex:outputPanel styleClass="grey" layout="block">
<apex:pageBlockSection columns="3">

<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >SIA Licence Type</apex:outputLabel>
<apex:inputField value="{!Employee__c.SIA_LICENCE__c}" style="width:80px"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >SIA Licence #</apex:outputLabel>
<apex:inputField value="{!Employee__c.Licence_No__c}" style="width:120px"/>
</apex:pageBlockSectionItem>
      
<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Expiry Date</apex:outputLabel>
<apex:inputField value="{!Employee__c.Expiry__c}" style="width:80px"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >CSCS Card?</apex:outputLabel>
<apex:inputField value="{!Employee__c.CSCS_Card__c}" style="width:80px"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >CSCS #</apex:outputLabel>
<apex:inputField value="{!Employee__c.CSCS__c}" style="width:120px"/>
</apex:pageBlockSectionItem>
      
<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Expiry Date</apex:outputLabel>
<apex:inputField value="{!Employee__c.CSCS_Expiry_Date__c}" style="width:80px"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >CCTV Licence?</apex:outputLabel>
<apex:inputField value="{!Employee__c.CCTV_Licence_Type__c}" style="width:80px"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >CCTV Licence #</apex:outputLabel>
<apex:inputField value="{!Employee__c.CCTV_Licence__c}" style="width:120px"/>
</apex:pageBlockSectionItem>

       
<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Expiry Date</apex:outputLabel>
<apex:inputField value="{!Employee__c.CCTV_Expiry__c}" style="width:80px"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Driving Licence?</apex:outputLabel>
<apex:inputField value="{!Employee__c.Driving_Licence__c}" style="width:80px"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem dataStyle="width:3%" labelStyle="width:30%" >
<apex:outputLabel >Driving Licence #</apex:outputLabel>
<apex:inputField value="{!Employee__c.Driving_Licence_Number__c}" style="width:120px"/>
</apex:pageBlockSectionItem>

       
<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Expiry Date</apex:outputLabel>
<apex:inputField value="{!Employee__c.Driving_Licence_Expiry__c}" style="width:80px"/>
</apex:pageBlockSectionItem>


                    
                        
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
 </apex:page>

 
Best Answer chosen by Sonya Dhand 3
Sonya Dhand 3Sonya Dhand 3
This issue has been resolved

All Answers

KapilCKapilC
Hi Sonya,

Could you please share the screenshot a little bit enlarge. Or send me attachment at forcecube@gmail.com.

Thanks,
Kapil
Henk WalgemoedHenk Walgemoed
Try: <apex:page cache="false" standardController="Employee__c">
Sonya Dhand 3Sonya Dhand 3
Unfortunately the same thing is happening and now also the calendar is disappearing off the screen as welel for the date fields

User-added image
KapilCKapilC
Sonya,

Fix your inline page width from the layout.

Thanks,
Kapil
Sonya Dhand 3Sonya Dhand 3
This issue has been resolved
This was selected as the best answer