title: Expand/Collapse Subtable in Datatable
body: <p>Is it possible to expand/collapse a subtable in a datatable? My subtable contains info relating to the row above it and I would like to show/hide onclick of an image. Just wondering how I'd go about it?</p>
  
  <p>This is what I'm currently using:</p>
  
  <pre><code>  &lt;rich:dataTable value="#{accountsBean.musicboxes}"  var="currentMusicBox"&gt;               
                  &lt;rich:column&gt;
                          &lt;h:graphicImage id="expand" value="../AccountsForms/images/details_open.png" onclick="toggleNotes(this);" /&gt;
                          &lt;rich:column&gt;&lt;h:outputText value="#{currentMusicBox.name}" /&gt;&lt;/rich:column&gt;
                          &lt;rich:column&gt;&lt;h:outputText value="#{currentMusicBox.username}" /&gt;&lt;/rich:column&gt;
                          &lt;rich:column&gt;&lt;h:outputText value="#{currentMusicBox.password}" /&gt;&lt;/rich:column&gt;
                          &lt;rich:column&gt;&lt;h:outputText value="#{currentMusicBox.location}" /&gt;&lt;/rich:column&gt;
                              &lt;rich:dataTable id="notesTable" value="#{currentMusicBox.notes}" var="currentNote" style="display: none;"&gt;
                                  &lt;rich:column&gt;&lt;h:outputText value="#{currentNote.body}" /&gt;&lt;/rich:column&gt;
                                  &lt;rich:column&gt;&lt;h:outputText value="#{currentNote.dateAdded}" /&gt;&lt;/rich:column&gt;
                                  &lt;rich:column&gt;&lt;h:outputText value="#{currentNote.note_type}" /&gt;&lt;/rich:column&gt;
                              &lt;/rich:dataTable&gt;
                   &lt;/rich:column&gt;
          &lt;/rich:dataTable&gt;
  </code></pre>
  
  <p>The problem is that only the first entry in my table displays ok. It is in the table and I can toggle image for notes. The rest of the entries are just one after each other (outside table with no formatting. Clicking on the image will open a table with related notes formatted properly</p>