-1

I have created the vf page on account in which account name and account number are read only and there is child object of account named as notes in which there is field notes which is editable on Vf page. i have used inline editing to do edit on vf page it is working in case of non empty, like if the field have the values but if the field is empty.the inline editing is not working.

<apex:form >
 <apex:pageBlock id="ThePage">


 <apex:pageBlockButtons location="both">
    <apex:commandButton id="update" action="{!UpdateNotes}" value="Save" reRender="ThePage" status="actStatusId"/>
     <apex:actionStatus id="actStatusId" >
                <apex:facet name="start" >
                  <img src="/img/loading.gif" />                    
                </apex:facet>
            </apex:actionStatus>
 </apex:pageBlockButtons>

    <apex:pageBlockSection columns="1">

      <apex:pageBlockTable value="{!lstSetController }" var="acc" >

            <apex:column >
                <apex:facet name="header">Account Name</apex:facet>
                <apex:outputtext value="{!acc.Name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">Account Number</apex:facet>
                <apex:outputtext value="{!acc.AccountNumber}"/>
            </apex:column>


            <apex:inlineEditSupport showOnEdit="update, cancelButton" hideOnEdit="editButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>

            <apex:column >
            <apex:facet name="header">Account Notes</apex:facet>            
            <apex:repeat value="{!acc.AccountNote}" var="note">

                <apex:outputField value="{!note.Notes__c}" rendered="{!If(note.Notes__c!=null,true,false)}" />
                <apex:inputField value="{!note.Notes__c}" rendered="{!If(note.Notes__c=null,true,false)}"/>              
            </apex:repeat>
            </apex:column>  

          </apex:pageBlockTable>



          <apex:outputPanel >
           <apex:commandButton value="<<Previous" action="{!previous}" rendered="{!hasPrevious}" reRender="ThePage" status="PrevStatusId" />
              <apex:actionStatus id="PrevStatusId" >
                <apex:facet name="start" >
                  <img src="/img/loading.gif" />                    
                </apex:facet>
            </apex:actionStatus>
           <apex:commandButton value="Next >>" action="{!next}" rendered="{!hasNext}" reRender="ThePage"  status="NextStatusId"  />
              <apex:actionStatus id="NextStatusId" >
                <apex:facet name="start" >
                  <img src="/img/loading.gif" />                    
                </apex:facet>
            </apex:actionStatus>
        </apex:outputPanel>  

    </apex:pageBlockSection>

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

</apex:page>
  • Explain your problem wider, post what you've tried and what problems you've encountered. – EvAzi Dec 13 '16 at 11:12
  • i have created the vf page on account in which account name and account number are read only and there is child object of account named as notes in which there is field notes which is editable on Vf page. i have used inline editing to do edit on vf page it is working in case of non empty, like if the field have the values but if the field is empty.the inline editing is not working. – anurag Dec 13 '16 at 11:15
0

I would suggest you to delete or comment:

<apex:outputField value="{!note.Notes__c}" rendered="{!If(note.Notes__c!=null,true,false)}" />

But pretty little information was given with no screenshots, so I'm not sure that it will solve your problem.

  • after doing this,the notes which are non empty got disappread. – anurag Dec 13 '16 at 11:31

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.