+ Start a Discussion
FastSnailFastSnail 

Support of inlineEditSupport and reRender

Hello everyone,
My problem: when a outputField uses inlineEditSupport, this function does not work when the field is reRender(ed). Thanks in advance for yur help.
Controller:
public class CNEmptyCon{
public Model__c mod{get;set;}
public String aop{get;set;}
public CNEmptyCon(){
aop='aop1';
List<Model__c> modList = [Select Id, name, ConsoL100km__c from Model__c ];
mod = modList.get(0);
}
public VOID aopUpd(){  aop='aopUpd'; }
public VOID save(){  update mod;}
}
Page
<apex:page controller="CNEmptyCon" >
<apex:form >
<apex:outputPanel id="aop1" >
<apex:commandButton value="showaopUpd" action="{!aopUpd}" reRender="aopUpd" /><br/>
</apex:outputPanel>
<apex:outputPanel id="aopUpd" >
<apex:outputPanel rendered="{!aop=='aopUpd'}" >
{!mod.name}: <apex:outputField value="{!mod.ConsoL100km__c}" >
<apex:inlineEditSupport showOnEdit="acbSave" event="onclick" disabled="false" />
</apex:outputField>
<apex:commandButton value="Save" action="{!save}" style="display:none;" id="acbSave" />
</apex:outputPanel>
</apex:outputPanel>
</apex:form>
</apex:page>
Process:
Case1, working: page is loaded with aop=aopUpd set in constructor: the inlineedit works fine.
Case2, NOT working: page is loaded with aop=aop1, then user clicks showaopUpd. aopUpd shows, but the inline edit does not work. Any idea?  Thanks in advance fopr your help,
Jerome
 
Best Answer chosen by FastSnail
FastSnailFastSnail
Thanks again William; I found the issue.  The issue is not whether it is at the form or the outputField level. My page had showHeader="false"; This prevent the reRender to work. Strange behavior. Is it 'As expected' or 'bug' ?
Without this, it works fine. Thanks again.

All Answers

William TranWilliam Tran
try rerendering at the form object level

so try :

<apex:form id= "formlevel">

then

<apex:commandButton value="showaopUpd" action="{!aopUpd}" reRender="formlevel" /><br/>

As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.

Thanks
FastSnailFastSnail
Hi William,
Thanks for such a quick reply, but no, it does not work. I tried at the form level, at the page level and any combination. inlineedit does not work after the reRender. Did you try? Maybe there is something strange on my side. Any other idea? Thanks again, Jerome
William TranWilliam Tran
It seems to work fine for me.  

Is your issue that you don't see the save button?  Try removing the style="display:none;"

So this is what you have:

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

Thx
FastSnailFastSnail
Thanks again William; I found the issue.  The issue is not whether it is at the form or the outputField level. My page had showHeader="false"; This prevent the reRender to work. Strange behavior. Is it 'As expected' or 'bug' ?
Without this, it works fine. Thanks again.
This was selected as the best answer
William TranWilliam Tran
FastSnail,

I am glad you found the issue.

That said, the code you posted did not have showHeader="false";  Be sure the post the correct code next time :-)

Thx