0

I have declared a boolean variable in apex

public Boolean StandardOnload{get;set;}

I have a VF page for this controller and in the vf page there is a outputPanel which is rendered on the basis of the Boolean in apex

<apex:outputPanel id="gr1" rendered="{!!StandardOnload}">

On the first load it is working fine, but inside my VF i have a dropdown and on the basis of that I am calling an action to update the value of this boolean

<apex:actionSupport event="onchange"  action="{!testMethod}" reRender="op1,pb1,gr1,gr2,gr22" status="spinnerStatus" oncomplete="showSave();" />

this is the testMethod

public void testMethod()
    {
        
        StandardOnload = true;
        
    }

But the value of Boolean is not updated in the context of vf.

Can someone please tell if i am missing anything

1 Answer 1

1

When you use rerender and render together, once the element is removed from the DOM, it can't be rendered again until there's a full page load. This is a limitation of how Visualforce performs its partial render logic. Make sure the target doesn't disappear.

In other words, you can do this:

<apex:outputPanel id="gr1">
  <apex:outputPanel rendered="{!!StandardOnload}">

Or just placing the ID somewhere up the component hierarchy, such that the conditionally rendered component is a child of the ID.

You must log in to answer this question.

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