4 Replies Latest reply on Mar 5, 2009 6:46 PM by fritzr

    subTabe omit < tr > for the first row

    fritzr

      Hi togehter,
      is it possible to omit the < tr >-Tag for the first row of the subtable?

      Background:
      I want to display a table like the following

      ----------------------------------- |
      | Row 1 | Subrow 1 |
      | |------------------------|
      | | Subrow 2 |
      -----------------------------------|
      
      Column1 has a dynamic calculated rowSpan based on the children size. My problem is, that the table looks like this:
      
      ----------------------------------- |
      | Row 1 | ------------------------|
      | | Subrow 1 |
      | |------------------------|
      | | Subrow 2 |
      -----------------------------------|
      


      Becaue the subrow starts with a new -environment, the usually html-convention can not be fullfilled: regulary you would provide the missing < td > and start a new row (tr) for the second subrow (subrow2).

      The problem is, that if row1 increases its title (larger height) the first (dummy) row increases as well.

      Any idea?

        • 1. Re: subTabe omit <tr> for the first row

          Can you write in pure html the layout you want to archive. It might be easy to understand what you want in this way

          • 2. Re: subTabe omit < tr > for the first row
            fritzr

            Hi,
            of course...

            I need something like this:

            1: <table>
            2: <tr>
            3: <td rowspan="2">Cause 1</td>
            4: <td>Place 1</td>
            5: </tr>
            6: <tr>
            7: <td>Place 2</td>
            8: </tr>
            9: </table>
            


            So the trick is, that my subtable delivers the Place items, based on the cause object. Now I need the subtable to omit the first and start the subitems within the first row (line 4) In my current configuration I have somethin like this:

            1: <table>
            2: <tr>
            3: <td rowspan="2">Cause 1</td>
            4: <td>manually inserted</td>
            5: </tr>
            6: <tr>
            7: <td>Place 2</td>
            8: </tr>
            9: </table>
            


            • 3. Re: subTabe omit < tr > for the first row
              alexsmirnov

              you do not need a subrow in this case, just define a rowspan for a first column. The table component have to skip rendering of the first column for subsequent rows.

              • 4. Re: subTabe omit < tr > for the first row
                fritzr

                Mmm, I think, that I don't understand you right...

                Can you pleae post an example?

                Here is my example:

                 <rich:dataTable id="causeList" var="cause" value="#{causes}" rowKeyVar="rowKey">
                 <f:facet name="header">
                 <rich:columnGroup>
                 <rich:column width="200">
                 <h:outputText value="#{msg.cause}" />
                 </rich:column>
                 <rich:column width="180">
                 <h:outputText value="#{msg.place}" />
                 </rich:column>
                 </rich:columnGroup>
                 </f:facet>
                
                 <!-- Insert causes -->
                 <rich:column rowspan="#{cause.rowSpan}" id="causeItem">
                 <h:outputText value="#{cause.causeType.cause}"/>
                 </rich:column>
                
                 <rich:column rendered="#{cause.rowSpan == 1}">
                 <h:commandLink action="createplace" styleClass="quickLink">
                 <f:param name="causeId" value="#{cause.id}"/>
                 #{msg.addPlaceLong}
                 </h:commandLink>
                 </rich:column>
                
                
                 <rich:subTable var="place" value="#{cause.places}">
                
                 <!-- Insert places -->
                 <rich:column rowspan="#{place.rowSpan}" id="placeItem" >
                 <h:outputText value="#{place.title}"/>
                 </rich:column>
                
                 <rich:column rendered="#{place.rowSpan == 1}" style="border-top:solid 1px #C0C0C0;">
                 <h:commandLink action="createconsequence" styleClass="quickLink">
                 <f:param name="placeId" value="#{place.id}"/>
                 #{msg.addConsequenceLong}
                 </h:commandLink>
                
                 </rich:column>
                 </rich:subTable>
                 </rich:dataTable>