Find your content:

Search form

You are here

Not Updating values when their is a rendering


I have a Vf page with rendering say

 <apex:outputpanel rendered="{!payment.paytype__c==true}">
     //My code goes here

In my class

public list<paypolicy__c> payment{get;set;}
    payid = apexpages().currentpage.getparameters().get('id');
    payment = [select paytype__c from paypolicy__c where id=:payid];
   //save method

    if(payid != null){
        //some code
       update payment;

if (payment.paytype__c==true) this condition becomes true then Update is not working....Help!!!!

Attribution to: Eagerin Sf

Possible Suggestion/Solution #1

I suspect this is because you are using the onclick event - this happens as soon as the user clicks into that element and will fire before the checkbox state is updated.

If you change this to the onchange event, that will fire after the checkbox value has been updated. Note that in some versions of IE the onchange doesn't fire until the element loses focus.

Attribution to: Bob Buzzard
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content