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 

two radio buttons cause issue

If I have a radio button defined as below everything works ok.  The field ratePlanId is updated with the selected value.

 

<apex:page controller="MyController">

   <apex:form>

      <apex:pageBlock>

           <apex:pageBlockSection id="ratePlanTable" title="Rate Plans">

                <apex:selectRadio id="ratePlanSelector" layout="pageDirection" value="{!ratePlanId}" required="true">

                     <apex:selectOptions value="{!ratePlans}"/>

                </apex:selectRadio>

            </apex:pageBlockSection>

       </apex:pageBlock>

    </apex:form>

</apex:page>

 

when I modify the page and add an additional radio button as below the ratePlanId setter is never called.  Oddly enough, from the debug log it looks the getter is called again instead of the setter.

 

             :  page block section with first radio button located here

             <apex:pageBlockSection id="ratePlanChargeTable" title="Rate Plan Charges">

                    <apex:selectRadio layout="pageDirection" value="{!ratePlanChargeId}" required="true">

                       <apex:selectOptions value="{!ratePlanCharges}"/>

                   </apex:selectRadio>

             </apex:pageBlockSection>

        </apex:pageBlock>

    </apex:form>

</apex:page>

 

Why does the presence of a second radio buttion cause the first radio button to no longer set a value when selected?

aballardaballard

maybe a validation error occurring?  Which would suppress calling the settes or action. 

 

Add an apex:messages to the top of your page to make sure you see any error messages.

SPruittSPruitt

This will go down as one of those unexplained mysterys.  i simply manually retyped in the components and it worked fine.  Previously I had copy-and-paste them in my page.  Must have picked up some unprintable characters or something preventing them working..