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
michael_hymichael_hy 

Issue on apex:dynamicComponent

Hi, So far I have an issue about dynamicComponent.
Hope someone can spend time on this. Thanks.

 

I have a page as below.

<apex:pageBlockSection columns="1" id="billingDetails">
      <apex:inputField id="billingFreq" value="{!objBillingPayerInfoController.payerInfo.Billing_Frequency__c}"/>
      <apex:inputField id="billingMeth" styleClass="billingpayerSelect" value="{!objBillingPayerInfoController.payerInfo.Billing_Method__c}">
      <!--<apex:dynamicComponent id="billingFreq" componentValue="{!DynamicAllowedValueServiceControllerObj.BillingFrequency}"/>-->
      <!--<apex:dynamicComponent id="billingMeth" componentValue="{!DynamicAllowedValueServiceControllerObj.BillingMethod}" />-->
      <apex:actionSupport event="onchange" action="{!objBillingPayerInfoController.loadBillingMethodSection}" rerender="billingDetails,eftAcctSec,creditCardSec" status="payerUpdateAction" />
      </apex:inputField>
 
                 
                  
                  <apex:pageBlockSection columns="1" collapsible="false" title="Credit Card Details" id="creditCardSec" rendered="{!objBillingPayerInfoController.showCreditCardDetails}">
                  <apex:inputField id="creditCardType" value="{!objBillingPayerInfoController.creditCardDetails.CreditCardType__c}" />
                  <apex:inputField id="creditCardNum" value="{!objBillingPayerInfoController.creditCardDetails.Card_Number__c}" />  
                  <apex:inputField id="cardHoldNum" value="{!objBillingPayerInfoController.creditCardDetails.NameOnCard__c}" />
                  <apex:inputField id="expiryDate" value="{!objBillingPayerInfoController.creditCardDetails.ExpiryDate__c}" />
                   
                  </apex:pageBlockSection> 
                   
                  <div class="bottomline"></div>
      </apex:pageBlockSection>   

loadBillingMethodSection() method is used to set showEftAccountSec property.

So the second pageBlockSection can display when I change the value in dropdown list.

 

 It run well if I use the apex:inputField label.

But after I change the inputField to dynamicComponent, the event onchange() cann't be invoke.

Do anyone knows how to resolve this?