3

I have written this code. I am trying to make the outputText inline editable.

<apex:outputText value="{0,date,MM'/'dd'/'yyyy}" rendered="{!!(pA.AcceptedDate__c==NUll&&pA.SentDate__c!=Null)}">
                        <apex:param value="{!pA.AcceptedDate__c}" />     
                    </apex:outputText> 

However InlineEdit tag can only be used with outputField tag. Now if I change this outputText tag to outputField it is giving me the following error value for <apex:outputField> is not a dynamic binding! It is extremely urgent and any help or ideas would be appreciated.

  • Can you share your code? It should work if you implemented this way. mindfiresolutions.com/… – Pranay Jaiswal Sep 5 '15 at 16:25
  • <apex:commandLink onclick="viewInviteAcceptDisclaimer('{!pubAut.id}'); return false;" rendered="{!(pubAut.AcceptedDate__c==NUll&&pubAut.SentDate__c!=Null)}" value="{!if((pubAut.AcceptedDate__c==NUll&&pubAut.SentDate__c!=Null),'Accept',pubAut.AcceptedDate__c)}" id="theCommandLink" /> <apex:outputText value="{0,date,MM'/'dd'/'yyyy}" rendered="{!!(pubAut.AcceptedDate__c==NUll&&pubAut.InviteSentDate__c!=Null)}"> <apex:param value="{!pubAut.AcceptedDate__c}" /> </apex:outputText> This is the code snippet @susanoo – Anamika Sep 5 '15 at 16:48
1

I tried to create a Visualforce Page and wrote some custom logic to Mimic the Inline Editing functionality for <apex:outputText. Not a 100% match though, but to some extent a decent one. Hope this helps.

VF Page

<apex:page standardController="Account" extensions="InlineEditingHelper">
  <apex:form>
    <apex:pageBlock title= "outputcomponents">
        <apex:outputPanel id="editfield">
            <apex:outputlabel value="Account Name (Double Click To Edit)   :  " for="Accname">
                <apex:actionSupport event="ondblclick" action="{!inlineEdit}" rerender="editfield"/>
            </apex:outputlabel>         
            <apex:outputText label="" value="{!Account.Name}" rendered="{!NOT(editmode)}" id="Accname"/>
            <apex:inputText label="" value="{!Account.Name}" rendered="{!editmode}" id="Accname2"/> 
        </apex:outputPanel>      
    </apex:pageBlock >
  </apex:form>
</apex:page>

Controller Extension

public with sharing class InlineEditingHelper {
    public boolean editmode {get;set;}
    public InlineEditingHelper(ApexPages.StandardController controller) {
        editmode = false;
    }
    public void inlineEdit() {
        system.debug('entered here');
        editmode = true;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.