You need to sign in to do that
Don't have an account?
Double-click instead of single click for custom SObject checkbox
I have the following Visualforce page in the Contacts page layout:
http://i.stack.imgur.com/QfpZV.png
A single click will toggle the checkbox selection ( as expected) and update the SObject field value. This is all good. However, I want to be able to change the checkbox value on a double-click, not on a single click. Something like how the same custom SObject checkbox behaves when otherwise used directly on the SF page layout (versus on a VF page) would also be nice:
http://i.stack.imgur.com/QW29E.png
Here is my VF page code for the SObject checkbox:
<apex:pageBlock id="theBlock"> <!-- first row --> <apex:pageBlockTable value="{!contact}" var="c"> <apex:column headerValue="On Approved List" width="111"> <apex:inputField value="{!c.EJF_On_Approved__c}"> <apex:actionSupport event="onclick" reRender="theBlock" action="{!saveRecord}"/> </apex:inputfield> </apex:column>
Suggested changes to the code if provided as complete code would be highly appreciated. Thanks!
Tried inline edit support?
Thank you for your response.
I tried inline editing - the issue is I am not able to change the checkbox selection because <apex:outputField> renders the field read-only. I need to toggle the checkbox on the VF page display.
Double-click on the SF page layout? I think you are talking about Inline edit?
Yes then why Avidev solution didn't worked?
Try adding this
<apex:outputField value="{!c.EJF_On_Approved__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
</apex:outputField>
showOnEdit="saveButton" This is the id of the save button.
Like this
<apex:commandButton value="Save" id="saveButton" action="{!Yourmethod}"/>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
Then you have to some more workaround. You can call an apex method through actionsupport from within inline edit support. Then from apex method you can render a popup section like standard sf layout and in that popup you can update that record.
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
"You can call an apex method through actionsupport from within inline edit support."
I'm wondering how I can do this when <apex:inlineEditSupport> has only the following attributes (no 'action'):
changedStyleClass
disabled
event
hideOnEdit
id
rendered
resetFunction
showOnEdit
I have an apex method that saves the checkbox selection; however, I don't know how to fire that method with inlineEditSupport (without button trigger). Earlier, I could do easily this with <apex:actionSupport> as this has the 'action' attribute. Also, having inlineEditSupport AND actionSupport together I guess doesn't accomplish anything, in which case the actionSupport action does not get triggered.
Require further guidance.
Try something like this
<apex:outputField value="{!c.EJF_On_Approved__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick">
<apex:actionsupport event="onchange" action="{!yourMethod}"/>
</apex:inlineEditSupport>
</apex:outputField>
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks