<!--Visual force page code-->
<apex:page controller="prgrm9cls"><apex:form >
<apex:pageBlock >
<apex:pageblockSection >
<apex:selectRadio value="{!paymentstatus}" id="paymentstatus">
<apex:selectOption itemValue="Credit" itemLabel="credit card" ></apex:selectOption>
<apex:selectOption itemValue="Po" itemLabel="PO"></apex:selectOption>
<apex:selectOption itemValue="Invoice" itemLabel="Invoice"></apex:selectOption>
<apex:actionSupport event="onchange" reRender="opid2" action="{!act}"/></apex:selectRadio></apex:pageblockSection>
<apex:pageBlockSection >
<apex:outputPanel id="opid2">
<apex:pageBlockSection rendered="{!cardz}" columns="1">
<apex:pageblockSectionItem >
<apex:outputLabel value="Credit Card Name"></apex:outputLabel><apex:inputText value="{!creditname}" />
</apex:pageblockSectionItem>
<apex:pageblockSectionItem >
<apex:outputLabel value="Credit CardNumber"></apex:outputLabel><apex:inputText value="{!CardNumber}" />
</apex:pageblockSectionItem>
<apex:pageblockSectionItem >
<apex:outputLabel value="CVV"></apex:outputLabel><apex:inputText value="{!CVV}" />
</apex:pageblockSectionItem></apex:pageBlockSection>
<apex:pageBlockSection rendered="{!invoicess}">
<apex:outputLabel value="Invoice"></apex:outputLabel><apex:inputText value="{!Invoice}" />
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!pozz}">
<apex:outputLabel value="Routing Number"></apex:outputLabel><apex:inputText value="{!porder}" required="true"/></apex:pageBlockSection></apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form></apex:page>public class prgrm9cls {
public String CVV { get; set; }
public Integer CardNumber { get; set; }
public String creditname { get; set; }
public String porder { get; set; }
public boolean pozz { get; set; }
public String paymentstatus { get; set; }
public String Invoice { get; set; }
public boolean invoicess { get; set; }
public boolean cardz { get; set; }
public PageReference act() {
if(paymentstatus == 'Credit'){
cardz = true;
invoicess = false;
pozz = false;
}
if(paymentstatus == 'Invoice'){
cardz = false;
invoicess =true;
pozz = false;
}
if(paymentstatus == 'po'){
cardz = false;
invoicess =false;
pozz = true;
}
return null;
}
}当我点击任何一个单选选项时,它应该会显示它的相关文本。它只执行了前两次,并且不能继续工作。
谁能解释一下这个错误是怎么造成的?
提前谢谢。
发布于 2013-09-17 18:19:04
对不起,我找出了错误。这是由于在面板中使用了'Required‘选项所致。删除了'Routing Number‘处的该选项
<apex:outputLabel value="Routing Number"></apex:outputLabel><apex:inputText value="{!porder}" required="true"/>解决了这个问题。
谢谢,拉文德拉,Salesforce工程师。
https://stackoverflow.com/questions/18844032
复制相似问题