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
doubleminusdoubleminus 

Another "rerender not working" post - have tried suggestions found elsewhere with no luck

So, I'm one of many unable to get rerender functionality working successfully. The actual update to the boolean istrue works successfully but the rerender refuses to work. Very simple use case here.

 

asish1989asish1989

Simply take Boolean variable and make it false in constructor and make true in side that function  and rerender the outer panel.

 

public class controller{

 public Boolean istrue{get;set;}

 

  public  controller(){

     istrue = false;

  }

public pageReference syncAccounts() {
     istrue = true;
   update sc;

   return null;
  }
}

 

<apex:form >
<apex:outputPanel id="pnl1">
<apex:outputPanel rendered="{!istrue}" id="pnl2">
<apex:outputText value="Work in progress." id="txt1" />
</apex:outputPanel>
<apex:outputPanel rendered="{!NOT(istrue)}" id="pnl3">
<apex:outputText value="There is no work in progress." id="txt2" />
</apex:outputPanel>
</apex:outputPanel>


<p>
<apex:commandButton action="{!doThings}" value="Sync Accounts" id="btn1" rerender="pnl1"/>
</p>
</apex:form>

 

doubleminusdoubleminus

asish1989 wrote:

Simply take Boolean variable and make it false in constructor and make true in side that function  and rerender the outer panel.

 

public class controller{

 public Boolean istrue{get;set;}

 

  public  controller(){

     istrue = false;

  }

public pageReference syncAccounts() {
     istrue = true;
   update sc;

   return null;
  }
}

 

<apex:form >
<apex:outputPanel id="pnl1">
<apex:outputPanel rendered="{!istrue}" id="pnl2">
<apex:outputText value="Work in progress." id="txt1" />
</apex:outputPanel>
<apex:outputPanel rendered="{!NOT(istrue)}" id="pnl3">
<apex:outputText value="There is no work in progress." id="txt2" />
</apex:outputPanel>
</apex:outputPanel>


<p>
<apex:commandButton action="{!doThings}" value="Sync Accounts" id="btn1" rerender="pnl1"/>
</p>
</apex:form>

 


 

Thank you for the reply. I don't show this, but I'm actually doing what you suggest already. It does not have any effect on rerender. I just double-checked to make sure.