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
Manohar kumarManohar kumar 

java script call from outputField double click

Hi Everyone,

I have a outputField which is uder repeat component. I have inlineEditSupport for inline editing. Now i made a html buttton on the top, my requirement is button should be dislayed only in inline edit mode.

i made a javascript fuction to display the button.

<script>
    	function showSave() {
    		alert('##');
    		document.getElementById('saveButton').style.display ="block";
    	}
    </script>
but i am not sure how to call this on double click for outputField.

i tried putting actionSupport in the outputField, but i am not sure.

Any help would be appreciated.

Thanks,

Manohar

 

SonamSonam (Salesforce Developers) 
Hi Manohar,

You need to change your approach and change your code like below code.

<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 values="ContactLst" var="contact">
<apex:outputField value="{!contact.lastname}">
<apex:inlineEditSupport showOnEdit="saveButton, cancelButton" hideOnEdit="editButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
</apex:outputField>
<apex:outputField value="{!contact.accountId}"/>
<apex:outputField value="{!contact.phone}"/>

</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>