首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用单选按钮更改选项

无法使用单选按钮更改选项
EN

Stack Overflow用户
提问于 2013-09-17 15:41:35
回答 1查看 651关注 0票数 0
代码语言:javascript
复制
<!--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>
代码语言:javascript
复制
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;
       }



    }

当我点击任何一个单选选项时,它应该会显示它的相关文本。它只执行了前两次,并且不能继续工作。

谁能解释一下这个错误是怎么造成的?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-09-17 18:19:04

对不起,我找出了错误。这是由于在面板中使用了'Required‘选项所致。删除了'Routing Number‘处的该选项

代码语言:javascript
复制
<apex:outputLabel value="Routing Number"></apex:outputLabel><apex:inputText value="{!porder}" required="true"/>

解决了这个问题。

谢谢,拉文德拉,Salesforce工程师。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18844032

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档