Hello Robert,
this is not that easy, but I build something a while ago for a combobox.
I think your problem is, that you want to acces radioGroup1 directly. Well, this element doesn't exist in the output html. You have to use "#{id:radioGroup1}" as the id, because XPages renders the ids anew when the XPage is rendered.
I built something similar a while ago. The bold text described how I accessed the data of the comboBox. Maybe this helps you, if you have further questions, please ask.
var urlString = "#{javascript:facesContext.getExternalContext().getRequestContextPath()}" + "/createSomething";
var values = new Array();
values['fd_LastName'] = document.getElementById("#{id:lastName}").value;
values['fd_FirstName'] = document.getElementById("#{id:firstName}").value;
values['fd_Title'] = document.getElementById("#{id:Title}").value;
var xhrArgs = {
url : urlString,
handleAs: "json",
content: values,
sync: "true",
load: function(response,ioArgs) {
XSP.partialRefreshGet("#{id:box}", {
params: {'valmode': 0},
onComplete: function(){
var cbx = document.getElementById("#{id:comboBox}");
var cbxname = cbx.name;
var count = document.forms[0].elements[cbxname].length;
for (var i = 0; i < count; ++i) {
if (document.forms[0].elements[cbxname].options[i].value == response['item']) {
document.forms[0].elements[cbxname].options[i].selected = true;
}
}
var dialogId = '#{id:dialog}';
dialogId = dialogId.replace(":callbackDialogContainer", "");
dijit.byId(dialogId).hide();
refreshId();
}
});
},
error: function(error) {
alert("An error has occured: " + error)
}
}
var deferred = dojo.xhrPost(xhrArgs);