2 Replies Latest reply on Feb 3, 2010 6:42 AM by Nick Belaevski

    Getting element id inside of rich:column

    Daniel Kim Newbie
      Hi

       

      I am trying to get element id this is inside of rich:column. If I take selectBooleanCheckbox out of rich:column, it works. (This only works in Firefox not IE.) So, it is not working inside of rich:column. I googled and tried, but wasn't successful.

       

      So, my questions are:
      1. how do I get element id inside of rich:column?
      2. why this doesn't work even outside of rich:column in IE?

       

      thx,

       

      -----------------------------------------------------------------------
      <h:form id="kpata" styleClass="edit">
      ...
      ...
      <h:selectBooleanCheckbox  value="#{quanChkBoxBean.kpataAllQ1}" id="kpataAllQ1" onclick="quanChkBox();"/> Select All Q1
      ...
      ...

       

      <rich:column>
           <h:selectBooleanCheckbox id="kpataCherokeeG1Q1"  value="#{quanChkBoxBean.kpataCherokeeG1Q1}" /><b/>
            <h:outputText value="Cherokee" />
        </rich:column>

       

      +++++++++++++++

       


      function quanChkBox(){
                                               if(document.getElementById('kpata:kpataAllQ1').checked==true){
                                                       document.getElementById('kpata:kpataCherokeeG1Q1').disabled = true;
      ...
      ...

       

      *****************************

      I found followings:

      this works since this is outside of rich:column:
      if (#{rich:element('kpata:kpataAllQ1')}.checked==true) {
              #{rich:element('kpata:kpataAllQ1')}.disabled = true;
      }


      but this doesn't work. (maybe this is inside of rich:column?)
      if(document.getElementById('kpata:kpataAllQ1').checked==true){
         alert("test2");          
         #{rich:element('kpata:kpataCherokeeG1Q1')}.checked = true;
        }

      ----

      anyway, rich:column causing problem and this seems obvious so far.