Find your content:

Search form

You are here

Not Updating values when their is a rendering

 
Share

I have a Vf page with rendering say

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

In my class

public list<paypolicy__c> payment{get;set;}
    //constructor
    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 https://salesforce.stackexchange.com/questions/5429

My Block Status

My Block Content