6 Replies Latest reply on May 1, 2007 12:35 PM by Sergey Smirnov

    Howto insert our own stuff in a rich:dataTable which uses ri

    Thai Dang Vu Apprentice

      Hi,

      I want to have a rich:dataTable like this (of course, this doesn't work):

      <rich:dataTable>
       <tr>
       <td colspan="2">
       <table>
       ...
       </table>
       </td>
       </tr>
       <rich:column ...>
       </rich:column>
      
       <rich:column ...>
       </rich:column>
      </rich:dataTable>


      Is it possible?

      I tried
      <rich:dataTable>
       <f:facet name="caption">
       <table>
       ...
       </table>
       </f:facet>
       <rich:column ...>
       </rich:column>
      
       <rich:column ...>
       </rich:column>
      </rich:dataTable>

      but it doesn't work.

        • 1. Re: Howto insert our own stuff in a rich:dataTable which use
          Sergey Smirnov Master

          Do you use JSF 1.2 or facelets?

          • 2. Re: Howto insert our own stuff in a rich:dataTable which use
            Sergey Smirnov Master

            Also, do you really need this additional inside?
            If not, rich:dataTable allows to use colspan and rowspan in the header. If you show the result html mockup you want to have, I can translate it into the rich dataTable notations.

            • 3. Re: Howto insert our own stuff in a rich:dataTable which use
              Thai Dang Vu Apprentice

               

              "SergeySmirnov" wrote:
              Do you use JSF 1.2 or facelets?
              Yes, I do. I use both JSF 1.2 and Facelets 1.1.12.
              "SergeySmirnov" wrote:
              If you show the result html mockup you want to have, I can translate it into the rich dataTable notations.
              It's very kind of you to say that. Here is my mocked-up html code:
              <table>
               <tr>
               <td colspan="3" align="center">
               <table width="100%">
               <tr>
               <td>Left Most</td>
               <td align="center">Something else here</td>
               <td align="right">Right Most</td>
               </tr>
               </table>
               </td>
               </tr>
               <tr>
               <td colspan="3" align="center">Maybe a caption here</td>
               </tr>
               <tr>
               <td>Header 1</td>
               <td>Header 2</td>
               <td>Header 3</td>
               </tr>
               <tr>
               <td>data</td>
               <td>data</td>
               <td>data</td>
               </tr>
               <tr>
               <td>...</td>
               <td>...</td>
               <td>...</td>
               </tr>
              </table>

              Actually, the inserted stuff doesn't need to be in the rich:dataTable but I need the width of the inserted stuff to be equal to the width of the rich:dataTable. So I place it inside the rich:dataTable.


              • 4. Re: Howto insert our own stuff in a rich:dataTable which use
                Sergey Smirnov Master

                I.e.:

                 <tr>
                 <td colspan="3" align="center">
                 <table width="100%">
                 <tr>
                 <td>Left Most</td>
                 <td align="center">Something else here</td>
                 <td align="right">Right Most</td>
                 </tr>
                 </table>
                 </td>
                 </tr>


                is not relative to the table, but inserted only to be aligned with it?

                The table starts with capture?

                • 5. Re: Howto insert our own stuff in a rich:dataTable which use
                  Thai Dang Vu Apprentice

                  Yes, that part has nothing to do with the data table, and I just need it to be aligned with the table.

                  "SergeySmirnov" wrote:
                  The table starts with capture?
                  Yes, the table starts with a caption on the first row, the column headers on the 2nd row, then data on the next rows.

                  • 6. Re: Howto insert our own stuff in a rich:dataTable which use
                    Sergey Smirnov Master

                    If I were you I prefer the following layout:

                    <table border="0">
                     <tr><td>
                     <table width="100%">
                     <tr>
                     <td>Left Most</td>
                     <td align="center">Something else here</td>
                     <td align="right">Right Most</td>
                     </tr>
                     </table>
                     </td>
                     </tr>
                     <td>
                     <table width="100%" border="1">
                     <tr>
                     <td colspan="3" align="center">Maybe a caption here</td>
                     </tr>
                     <tr>
                     <td>Header 1</td>
                     <td>Header 2</td>
                     <td>Header 3</td>
                     </tr>
                     <tr>
                     <td>data</td>
                     <td>data</td>
                     <td>data</td>
                     </tr>
                     <tr>
                     <td>...</td>
                     <td>...</td>
                     <td>...</td>
                     </tr>
                    </table>
                     </td>
                     </table>


                    Transforming to the JSF code, it mean wrapping the table and top text with panelGrid. Something like:


                    <h:panelGrid column="1">
                    
                     <h:panelGroup>
                     <table width="100%">
                     <tr>
                     <td>Left Most</td>
                     <td align="center">Something else here</td>
                     <td align="right">Right Most</td>
                     </tr>
                     </table>
                     </h:panelGrid>
                    
                     <rich:dataTable width="100%">
                     ....
                     </rich:dataTable>
                    
                    </h:panelGrid>