Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know which Radio Button is selected?

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?

like image 856
balajiboss Avatar asked Nov 03 '22 20:11

balajiboss


1 Answers

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.

like image 141
Henrique G. Abreu Avatar answered Nov 08 '22 05:11

Henrique G. Abreu