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
MSVRadMSVRad 

ActionSupport event"On Change" doesnt really work on change?

I am creating visual force pages for to override New, Edit, and Detail view for a custom object. I am using ActionSupport event On Change for a checkbox. Why is it that when I check the checkbox the even that would be considered "on change" the section of the page that should be rendered on this action does not display. It displays if I click outside of the checkbox after the checkbox has been checked.

 

There is a lot more to add to this extension but I wanted to test that it functioned properly before I coded anymore.

 

Here is the Controller extension:

public with sharing class GoLiveController { public Go_Live_Process__c glp; public apexpages.standardController controller {get; set;} public GoLiveController(ApexPages.StandardController stdController) { // constructor controller = stdController; this.glp= (Go_Live_Process__c)stdController.getRecord(); Go_Live_Process__c goLives = (Go_Live_Process__c)stdController.getRecord(); goLives = [SELECT Account__c FROM Go_Live_Process__c WHERE id=:system.currentpageReference().getparameters().get('id')]; } //Property for Credentialing checkbox public Boolean showCredentialing{ get{ if(showCredentialing == null){ showCredentialing = false; } return showCredentialing; } set; } //Property for client agreement checkbox public Boolean showClientAgreement{ get{ if(showClientAgreement == null){ showClientAgreement = false; } return showClientAgreement; } set; } }

Here is part of the visual force page:

 

... <apex:pageBlockSectionitem > <apex:outputLabel value="Client Agreement"/> <apex:inputCheckBox value="{!showClientAgreement}"> <apex:actionSupport event="onchange" rerender="EditForm" status="showClientAgreement" /> </apex:inputCheckBox> </apex:pageBlockSectionitem> <apex:actionStatus startText="(rendering Client Agreement Go Live...)" id="showClientAgreement"/> </apex:pageBlockSection> <apex:actionRegion > <apex:pageBlockSection title="Client Agreement" rendered="{!showClientAgreement}" id="closeoutBlock" columns="2"> <apex:inputField value="{!Go_Live_Process__c.Privileges_issued__c}"/> </apex:pageBlockSection> </apex:actionRegion> ...

Any Ideas? I know how it works and I think it would be okay but I think that users would complain about having to click outside of the checkbox even after they have already checked the box.

 

Thanks!

Message Edited by MSVRad on 10-16-2009 11:10 AM
Best Answer chosen by Admin (Salesforce Developers) 
jwetzlerjwetzler
Sounds like you are using IE.  IE doesn't fire the onchange event for a checkbox until the box has lost focus (i.e. onblur).  Use onclick instead.

All Answers

jwetzlerjwetzler
Sounds like you are using IE.  IE doesn't fire the onchange event for a checkbox until the box has lost focus (i.e. onblur).  Use onclick instead.
This was selected as the best answer
MSVRadMSVRad
Thanks Jill, this worked perfectly.
gazazellogazazello

Thanks jwetzler! Pretty soon we'll start begging customers to switch to more predictable browsers.