+ Start a Discussion
padmaja shivane 4padmaja shivane 4 

how to asign status to checkbox when it is true

hi,
one checkbox is on my vf when this checkbox enable then related incident must be changed there status
plz can you me the solution ,how to assign status to this checkbox
S@kh!S@kh!
are Incidents related list? if so then you can simply write a javscript code ionchange on checkbox which will call some apex controller method to save the status of incidents.
padmaja shivane 4padmaja shivane 4
can you give me the javascript code
NNRNNR
Hi Padmaja,
when your check box is true it will change the some other information in your page right,
use the actionsupport for check box and event is onchange and write your logic in your apex method
ex:
<apex:checkbox value={!obj.checked} event="onchange">
  <apex:actionsupport action="{!checkedmethod}" />
</apex:checkbox>

controller::
public void checkedmethod(){
  if(!obj.checked){
  obj.status__c='activated';
}
update obj;
}

plz:check syntax