Radio Buttons

how to set a default selection in a dynamically generated radio buttons


I have a page made with UI designer which contains a radio buttons widget.

The available values are filled using a javascript expression retrieving all the groups the user belongs to :

function getGroupNames(data) {
var noms = [];
for( var i = 0; i < data.length; i++ ) {
noms[i] = data[i];
return noms;

return getGroupNames( $data.listeGroupes );

The selected value is a string variable.

Radio Buttons

How can I use a radio button's value (which has just two distinct values true and false) in a boolean variable?
I have defined a business variable e.g "testVar" which has a boolean field say "bb".
How can I bind to radioButton.value and return "testVar" as the formOutput?
Thanks in advance