如何知道选择了哪个单选按钮? [英] How to know which Radio Button is selected?

查看:122
本文介绍了如何知道选择了哪个单选按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在同一个广播组中,我的Ui中有3个单选按钮。他们是,

  var rbutton1 = app.createRadioButton('dist','5 miles'); 

var rbutton2 = app.createRadioButton('dist','10 miles');

var rbutton3 = app.createRadioButton('dist','25 miles');

在事件处理函数中,变量 e.parameter.dist 只是根据是否选中rbutton3(最后一个单选按钮)给出了真或假。有没有什么方法可以确定单选按钮的选择是准确的?

解决方案

使单选按钮组工作的唯一方法就是这样按照设计的意图)通过在 FormPanel 中使用它们并从表单的提交动作中查看doPost上的名称(在您的情况下为dist)。



尽管有一些解决方法,使用新的客户端处理程序可以使任何面板上的单选按钮使用情况大体上与使用相同。请参阅此问题在追踪器上。您可能也想要 这个问题,以跟踪更新和投票类型。


I have 3 Radio buttons in my Ui in the same Radio group. They are,

var rbutton1 = app.createRadioButton('dist','5 miles');

var rbutton2 = app.createRadioButton('dist','10 miles');

var rbutton3 = app.createRadioButton('dist','25 miles');

In the event handler function, the variable, e.parameter.dist gives true or false just based on whether rbutton3 (the last radio button) is checked or not. Is there any way to determine what radio button is selected exactly?

解决方案

The only way the make radio buttons group work like this (as intended by design) is by using them in a FormPanel and looking the name (in your case "dist") on a doPost from a submit action of the form.

There's some workarounds though, using the new client handlers that make it radio buttons usage on any panel roughly the same as on the from. Please take a look at this issue on the tracker. You may want to star this issue as well, to keep track of updates and kind of vote for it.

这篇关于如何知道选择了哪个单选按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆