1 Reply Latest reply on Aug 9, 2013 4:32 AM by ibenjes

    collabsibleSubTable does not use style of parent row

    ibenjes

      In RF 3 we used a rich:dataTable with a rich:subTable to achieve something like this:

      subtable.jpg

      On the main table we had the company name and then in the subtable one or more contact details for this company. The styling was so that we had alternative background (white, light blue). This background was used by the subtable as well.

       

      Now after migrating this to RF4 we get this:

      collabsible.jpg

      As you can see the 'main' table background is still alternating but the background of the collabsible panel is always white. How can I get the collabsible table to use the background of its parent table row?

       

      One more thing. I've noticed that if you use rich:columnGroup in the collabsibleTable nothing in that group is shown. Looks like a bug to me.

        • 1. Re: collabsibleSubTable does not use style of parent row
          ibenjes

          Hi,

           

          The only way I found to get this working is to use a rowKeyVar on the parent table and set the style of each of the columns in the collabsibleSubTable like shown below. I didn't find a way to apply this to the whole row. Anyway it works. You just need to make sure that you don't have any paddings/margin around the cells.

           

          {code}

          <rich:dataTable

          value="#{testBean.address} var="address"

          rowKeyVar="parentKey"

          rowClasses="tableRowOdd, tableRowEven">

          <rich:column>

          #{address.name} <!-- Each row has alternating style -->

          </rich:column>

          <rich:collabsibleSubTable value="#{address.contactDetails} var="detail" expanded="true" expandMode="client">

          <rich:column styleClass="#{parentKey % 2 eq 0 ? 'tableRowOdd' : 'tableRowEven'}">

          #{detail.addressLine}

           

          </rich:column>

          <rich:column styleClass="#{parentKey % 2 eq 0 ? 'tableRowOdd' : 'tableRowEven'}">

          #{detail.postCode}

          </rich:column>

           

          </rich:dataTable>

          {code}

           

          Please note

           

          {code}

          #{parentKey % 2 eq 0 ? 'tableRowOdd' : 'tableRowEven'}"

          {code}

          is not a mistake as the parentKey starts at 0 (otherwise you have to do (parentKey+1) % 2 eq 0 ? 'tableRowEven' : 'tableRowOdd'