Here is the visual force page:

<apex:page controller="MyNotesController" showHeader="false" sidebar="false" >
     <apex:includeScript value="/support/console/25.0/integration.js"/>
        html body.sfdcBody {
            background-color: #FFFFCC;

    <apex:form style="overflow:auto;width:750px;height:300px;background-color:#FFFFCC; border:0px; margin:0px;">

       <apex:outputPanel id ="noteListSection">
        <apex:dataList id="noteslist" value="{!noteslist}" var="note"  rendered="{!showNoteList}">
        <!--<apex:outputText value = "{!note.id}"/> -->
            <apex:outputLink onclick="openNote('{!note.id}');return false;"><apex:outputText value="{!note.Note_Header__c}"/> </apex:outputLink>


         <apex:outputPanel id="noteDetailPanel" rendered="{!showNoteDetail}">  

            <textarea id="notesInput">  {!Notes}</textarea>  
            <!--<textarea id="notesInput" style="overflow:auto;width:750px;height:300px;background-color:#FFFFCC; border:0px; margin:0px;" onkeyup="saveNotes();" >  {!Notes}</textarea>  -->

        <apex:actionFunction action="{!setNotes}" name="setNotesJS" reRender="">
            <apex:param name="note" assignTo="{!Notes}" value=""/>
        <apex:actionFunction action="{!openNote}" name="openNotesJS" reRender="noteListSection,noteDetailPanel">
            <apex:param name="noteId" assignTo="{!noteId}" value=""/>


        var notesTextArea = document.getElementById('notesInput');        
        function saveNotes() {
         function openNote(noteId) {
            return false;




Controller code :

public class MyNotesController {

    My_Notes__c myNotepad;
    Integer notesCount;    
    public List <My_Notes__c>  noteslist {get;set;}
    public String Notes{ get; set;} 
    public String noteId{ get; set;} 
    public boolean showNoteDetail {get; set;} 
    public boolean showNoteList {get; set;} 

    public MyNotesController() {
         notesCount = [Select COUNT() from My_Notes__c where ownerId = :UserInfo.getUserId()];   
         //if(noteslist==null ||!noteslist.isEmpty())      
         //showNoteList =true;
         //showNoteDetail =false;

    //public void init() {
   public List <My_Notes__c> getNoteslist(){
         //My_Notes__c  notesObject;
         System.debug('init  method'+ NotesCount);
         if (notesCount > 0) {

             noteslist = [Select id,Note__c,ownerId,Note_Header__c,lastmodifiedDate from My_Notes__c where ownerId = :UserInfo.getUserId() order by lastmodifiedDate];   
              showNoteList =true;          
System.debug('Notes noteslist ' + noteslist.size());
         return noteslist;
         //myNotepad = notesObject;
         //Notes = notesObject.note__c;

    public void createNewNote(){
           // notesObject = new My_Notes__c();
           //  notesObject.ownerId = UserInfo.getUserId();

    public pagereference openNote(){
           // notesObject = new My_Notes__c();

           System.debug('Inside openNote method');
        System.debug('Note Id1=>' + noteId);
        My_Notes__c notesObject  = [Select id,Note__c,ownerId,Note_Header__c,lastmodifiedDate from My_Notes__c where id = :noteId limit 1];             
           Notes = notesObject.note__c;
          System.debug('Notes data ' + Notes);  
        showNoteDetail =true;

        System.debug('Inside openNote method : showNoteDetail'+showNoteDetail);
        System.debug('Inside openNote method : showNoteList'+showNoteList);
        //PageReference thisPage = ApexPages.currentPage();
        return null;


My problem here is that the output panel "noteDetailPanel" is not rendering. any pointers would be helpful.

1 Answer 1


You cannot rerender an element if it has a conditional render attached to it and the condition will not rerender so its state will remain the same (shown or hidden depending on the condition). You have to rerender the parent element

So add an ID to your form and rerender that

  • This is amazing....Eric this comment of yours should be part of the visualforce documentation in bold :)
    – VPY
    Jun 4, 2017 at 10:18
  • 1
    @Eric thanks a lot, this worked great. Apr 15, 2019 at 0:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .