You need to sign in to do that
Don't have an account?
FastSnail
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
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
Without this, it works fine. Thanks again.
All Answers
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
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
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
Without this, it works fine. Thanks again.
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