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>

[1169 byte] By [RishabGuptaa] at [2007-11-27 5:25:20]
# 1
Are you occurring the same problems when you try the samples provided in the EAR's there?
BalusCa at 2007-7-12 14:45:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
NO I use the sample code provided in ur page
RishabGuptaa at 2007-7-12 14:45:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

OK, if the samples in the EAR works fine, then the problem lies somewhere in your own code. Well, I can't say anything else than just to debug it.

Oh I see the "pc_" prefix indicating the use of IBM's autogenerated pagecode (yuck). If you haven't coded it all manually, I shouldn't be surprised if those autogenerated stuff is causing those problems. Just start off from clean, based on the examples provided in the EAR. Don't touch that WYSYSYG JSF editor of WSAD/RAD and absolutely don't use the "pagecode" heap :)

BalusCa at 2007-7-12 14:45:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...