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
SPruittSPruitt 

can't get inputCheckbox to work

The following is defined on a VPage

 

<apex:form>

     <apex:actionFunction name="checkSameAsCustomer" action="{!sameAsCustomer}" rerender="billToSection">
          <apex:param name="checkSameAsParam" assignTo="{!isSameAsCustomer}" value="sameAsCustomerCheck.selected"/>
     </apex:actionFunction>

     <apex:pageBlock>

             :

          <apex:inputCheckbox id="sameAsCustomerCheck" label="Billing same as above" onselect="checkSameAsCustomer" immediate="true"/>

          <apex:pageBlockSection id="billToSection">

             :

 

The inputcheckbox doesn't appear to be invoking the actionFunction.  My controller's implementation of sameAsCustomer writes to the debug log, but nothing shows up.

 

I have tried setting onselect, onchange, and onclick.  Also, as a separate issue the inputcheckbox label never shows either.

 

Thanks in advance.

Edwin VijayEdwin Vijay

Might be that your form taga are causing a problem?

 

Also, did you try using actionsupport?

jwetzlerjwetzler

Yes it's definitely easier to just use actionSupport. See this example: http://boards.developerforce.com/t5/Visualforce-Development/displaying-an-input-field-after-checking-a-checkbox-on-VF-page/m-p/309087/highlight/true#M38414

 

You might also be having a problem with immediate="true" as that bypasses all your setters, so you should remove that (it's typically used for things like "cancel").

 

Also the label attribute has to be inside a pageBlockSection component to show up.

SPruittSPruitt

Yes,  ActionSupport worked nicely.  Thank you.