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
imAkashGargimAkashGarg 

ilineEdit mode not working

i have used ilineEdit mode in pageblocktable, but it is not working:

 

<apex:pageBlock title="test" mode="inlineEdit">
   <apex:pageBlockTablevalue="{!addr_list}" var="addr" >
       <apex:column headerValue="City">{!addr.City__c}</apex:column>
       <apex:column headerValue="State">{!addr.State__c}</apex:column>
   </apex:pageBlockTable>

   <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>

</apex:pageblock>

 

Please suggest.

 

Puja_mfsiPuja_mfsi

HI,

You need to add "<apex:inlineeditsupport />" in the apex:colum to add inline edting in PageBlockTable.

You can take reference from the below URL:

 

http://www.codespokes.com/2012/09/inline-editing-in-pageblocktable.html

 

 

Please let me know if u have any problem on same and if this post helps u please throw KUDOS by click on star at left.

imAkashGargimAkashGarg

But when i just do this:

 

<apex:page standardController="account" >
<apex:form >
<apex:pageBlock mode="inlineedit">
<apex:outputField value="{!account.name}"/>
</apex:pageBlock>
</apex:form>
</apex:page>

 

it works here without "<apex:inlineeditsupport />"

Puja_mfsiPuja_mfsi

Hi,

In this case it inherit the standardController property,But in case of PageBlockTable you need to add "<apex:inlineeditsupport />" for <apex:column>

 

<apex:inlineEditingSupport> component, which gives inline editing functionality to several container components.

 

 

Please let me know if u have any quesry on same and if this post helps u please throw KUDOS by click on star at left.

imAkashGargimAkashGarg

Thanks for the promt response.

 

As per the documentation, inlineedit support is only available for these components:

 

  • < apex:dataList >
  • < apex:dataTable >
  • < apex:form >
  • < apex:outputField >
  • < apex:pageBlock >
  • < apex:pageBlockSection >
  • < apex:pageBlockTable >
  • < apex:repeat >

 

imAkashGargimAkashGarg

there is no such component like "<apex:inlineEditingSupport"

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

For your information, inline edit cannot be applicable for object's 'Name' field. But other than that field you can do apply inline edit for custom as well as standard field.

 

There are two ways to do the inline editing. It is shown below,

  1. Mentioning mode="InlineEdit" in pageblock.
  2. Using <apex:inlineEditSupport> component of VF page.

Try the followin Examples,

VF page:

<apex:page standardController="Contact" extensions="contactController">
    <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>


          <apex:pageBlockTable value="{!conts}" var = "c" >               

              <apex:column headerValue="Name">
                  <apex:outputField value="{!c.AccountId}">
                     <apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
                        hideOnEdit="editButton" event="ondblclick"
                        changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
                  </apex:outputField>                     
                 </apex:column>                
                  <apex:column headerValue="Name">
                      <apex:outputField value="{!c.phone}"/>
                 </apex:column>                
         </apex:pageBlockTable >
      </apex:pageBlock>
    </apex:form>
</apex:page>

 

Controller:

public class contactController{
 ...........
    public List<contact> conts{get;set;}
...................
    public contactController(Apexpages.Standardcontroller con){
       cont = (Contact)con.getrecord();  
       conts = [SELECT id,name,AccountId,phone from Contact where name =: 'Kamatchi'];  //Here use your query
    }
 .........................
}

 

Hope so this helps you...!

Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.

KodiKodi

Hi,

 

This is sample code for inline edit.

 

<apex:pageBlock>

<apex:pageBlockSection>

<apex:pageBlockTable value="{!data}" var="d1">

<apex:column>

<apex:facet name="header">Project Amount</apex:facet>

<apex:outputField value="{!d1.Payment_Amount__c}" >

<apex:inlineEditSupport showOnEdit="{!d1.Payment_Amount__c}"/></apex:outputField>

</apex:column>

</apex:pageBlockTable>

</apex:pageBlockSection>

</apex:pageBlock>

 

imAkashGargimAkashGarg

I have to use inline editing in a page with custom controller. will it have an affect?

 

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Yeah sure, It will not be a problem for you.

 

You can use inline edit option both by using custom or standard controller.

 

 

Hope so this helps you...!

Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.