1 Reply Latest reply on Sep 8, 2011 1:58 AM by mani v

    datatable and <h:selectOneRadio>

    thexternal Newbie

      I am using datatable and each row of datatable contain <h:selectOneRadio>
      component. i want that one of radio button can select at same time on datatable. thanks...

        • 1. Re: datatable and <h:selectOneRadio>
          mani v Newbie

          function dataTableSelectOneRadio(radio) {

               var id = radio.name.substring(radio.name.lastIndexOf(':'));

              var id2=":testdata";    var i2=0;    var el = radio.form.elements;

              for (var i = 0; i < el.length; i++) {        if (el[i].name.substring(el[i].name.lastIndexOf(':')) == id) {

                      el[i].checked = false;        

                  }        }    }

              radio.checked = true;

                }

          ////inside datatable

          <h:selectOneRadio onclick="dataTableSelectOneRadio(this);updateName(#{Employee.no});"

                                      id="radioBtn"  >

                                      <f:selectItem itemValue="#{Employee.no}" />

                                  </h:selectOneRadio>

          ////

          <a4j:jsFunction name="updateName" render="popup">

          <a4j:param name="name" assignTo="#{EmployeePage.SelectedRadio}"/>

          </a4j:jsFunction>