Problem regarding radio button
Hi Balu
I had gone through ur site http://balusc.xs4all.nl/srv/dev-jep-dat.html.
I tried to implement radio button in jsf. I am getting 2 problem while implementing this. When i run the page I am not getting any button as checked. And the other problem is that When I am trying to check the radio button there is no single selection. Actually when i tried to check the second button. It allows and when I tried to check the third the first one get removed. That means that any time there are two radio button checked.
Below is the code which I am using
function dataTableSelectOneRadio(radio) {
var id = radio.name.substring(radio.name.lastIndexOf(':'));
var el = radio.form.elements;
for (var i = 0; i < el.length; i++) {
if (el.name.substring(el.name.lastIndexOf(':')) == id) {
el.checked = false;
}
}
radio.checked = true;
}
<h:selectOneRadio
valueChangeListener="#{pc_ProjectAdministration.setSelectedItem}"
onchange="dataTableSelectOneRadio(this);">
<f:selectItem itemValue="null" />
</h:selectOneRadio>

