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 

Help needed with Inline Editing of a VF page on a custom object?

<apex:page standardController="Employee__c">
<apex:form >
<apex:pageBlock mode="inlineEdit" >
<apex:pageBlockButtons >

                <apex:commandButton action="{!edit}" id="editButton" value="Edit"/>

                <apex:commandButton action="{!save}" id="saveButton" value="Save"/>

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

            </apex:pageBlockButtons>

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

<apex:pageBlockSectionItem dataStyle="width:0%" labelStyle="width:10%" >
<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 >Licence #</apex:outputLabel>
<apex:inputField value="{!Employee__c.Licence_No__c}" style="width:95px"/>
</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.Licence_No__c}" style="width:95px"/>
</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__c}" style="width:80px"/>
</apex:pageBlockSectionItem>

<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Licence #</apex:outputLabel>
<apex:inputField value="{!Employee__c.Licence_No__c}" style="width:95px"/>
</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 >Driving Licence?</apex:outputLabel>
<apex:inputField value="{!Employee__c.Driving_Licence__c}" style="width:80px"/>
</apex:pageBlockSectionItem>


<apex:pageBlockSectionItem dataStyle="width:10%" labelStyle="width:23%" >
<apex:outputLabel >Licence #</apex:outputLabel>
<apex:inputField value="{!Employee__c.Driving_Licence_Number__c}" style="width:95px"/>
</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:inlineEditSupport showOnEdit="saveButton, cancelButton"

                        hideOnEdit="editButton" event="ondblclick"

                        resetFunction="resetInlineEdit"/>
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
 </apex:page>

 
Best Answer chosen by Sonya Dhand 3
Sonya Dhand 3Sonya Dhand 3
Hi Kapil -  Apologies I have another question now, this one has actually been resolved.  I now have an issue with refreshing  https://developer.salesforce.com/forums/ForumsMain?id=906F0000000kE94IAE

All Answers

KapilCKapilC
Hi Sonya,
What kind of help you need?

Thanks,
Kapil
Sonya Dhand 3Sonya Dhand 3
Hi Kapil

So as I wrote above, the vf page isn't refreshing as expected when data is edited and saved - see the image above?

it should look like this 

User-added image

but looks like this after refreshing....

User-added image
Sonya Dhand 3Sonya Dhand 3
Hi Kapil -  Apologies I have another question now, this one has actually been resolved.  I now have an issue with refreshing  https://developer.salesforce.com/forums/ForumsMain?id=906F0000000kE94IAE
This was selected as the best answer
KapilCKapilC
Hi Sonya,

give a try to do this. Replace your first line with below code.
<apex:page standardController="Employee__c" showHeader="flase" sidebar="false">

Thanks,
Kapil
KapilCKapilC
Hey Sonya,
I replied on that thread as well.

Thanks,
Kapil
 
Sonya Dhand 3Sonya Dhand 3
Hi Kapil Unfortunately that didn't work. I still have the same issue. Thanks Sonya