title: Display Dynamic Checkbox in <rich:datatable and based on user selection rendered TextArea for current Object
body: <p>Hi I am attaching my code, My problem i si am getting a list from the database and i am dispalying on the UI in a datatable with only checkbox.</p>
  
  <p>Once user will select any of the check box then i need to renderedd on text area for that checkbox. So checkbox and textarea will be dynamic.</p>
  
  <p>I have written some code in bean also but that is not working for first object it is working fine but for remaining object it is not workinhg please help to resolve problem</p>
  
  <p>Bean Code:</p>
  
  <pre><code>public void addSharedMessage()
  {   
      for(DocumentTypeDTO documentTypeDTO1 : shareGovtAgencyList)
  {
      System.out.println(documentTypeDTO1.getSelected());
      if( documentTypeDTO1.getSelected())
          {
          this.setSharedMessageRendered(true);
          setSharedMessageRendered(true);             
      } else {
          this.setSharedMessageRendered(false);
      }
  }
  }
  </code></pre>
  
  <p>XHTML code:</p>
  
  <pre><code>&lt;rich:dataTable width="100%" id="searchResult" border="0" rowKeyVar="
      value="#{myBean.sharedList}" var="item"
      headerClass="head" cellpadding="2" 
      rowClasses="odd,even" cellspacing="0" bgcolor="#FFFFFF"&gt;
  
      &lt;rich:column  style="text-align:center; background-color:#FFFFFF" width="1%"&gt;
       &lt;h:selectBooleanCheckbox  id="khudh" value="#{item.selected}" immediate="true" &gt;
           &lt;a4j:support event="onchange" action="#{myeBean.addSharedMessage}"                              reRender="committeemenbersname" /&gt;
           &lt;/h:selectBooleanCheckbox&gt;                            
      &lt;/rich:column&gt;
      &lt;rich:column  style="background-color:#FFFFFF" id="committeemenbersname" &gt;
       &lt;h:outputText value="#{item.documentName}" /&gt;
       &lt;rich:separator lineType="none" /&gt;
           &lt;h:inputTextarea id="shareProfileComment" rows="2" cols="45"  
                rendered="#{myBean.isSharedMessageRendered}"  &gt;
               &lt;f:validateLength maximum="200" /&gt;
           &lt;/h:inputTextarea&gt; 
      &lt;/rich:column&gt;
   &lt;/rich:dataTable&gt;
  </code></pre>