仅当 inputField“Gift_ c.PaymentMethod _c”(这是一个下拉菜单)具有特定值(即“信用卡”)时,我才想显示 pageBlockSection“ccBlock” 。我已经尝试了很多方法,但到目前为止没有运气。
<apex:pageBlockSection title="Basic Information" columns="1" >
<apex:inputField value="{!Gift__c.Contact__c}"/>
<apex:inputField value="{!Gift__c.PaymentMethod__c}" id="payMethod" >
<apex:actionSupport event="onchange" reRender="ccBlock, bankBlock" action="{!HideBlock}" />
</apex:inputField>
</apex:pageBlockSection>
<apex:pageBlockSection title="Credit Card" rendered="{!visi}" columns="1" id="ccBlock">
<apex:inputField value="{!Gift__c.CCType__c}"/>
<apex:inputField value="{!Gift__c.CCName__c}"/>
<apex:inputField value="{!Gift__c.CCNumber__c}"/>
<apex:inputField value="{!Gift__c.CCExpiryMonth__c}"/>
<apex:inputField value="{!Gift__c.CCExpiryYear__c}"/>
</apex:pageBlockSection>