开发者

How do i edit a Data Table-->columnGroup to have multiple column groups with complex header?

This is a base sample with 3 rows of data displayed under 1 columnGroup heading and 3 column headings and then the 3 columns of data:

<rich:dataTable value="Some Table"> 
    <f:facet name="header">
        <rich:columnGroup>
            <rich:column colspan="3">
                <h:outputText value="ColumnGroupHead"/>
            </rich:column>
            <rich:column breakBefore="true">
                <h:outputText value="Col 1 head"/>
            </rich:column>
            <rich:column>
                <h:outputText value="Col 2 head"/>
            </rich:column>
            <rich:column>
                <h:outputText value="Col 3 Head"/>
            </rich:column>
        </rich:columnGroup>
    </f:facet>
     <rich:column>
        <h:outputText value="Col1 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col2 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col3 Data"/>
    </rich:column>     <rich:column>
        <h:outputText value="Col4 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col5 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col6 Data"/>
    </rich:column>
</rich:dataTable>

Now in relaity, my dataTable contains 6 columns, and i want the same complex header as in example above for columns 4,5,6. I have tried the follwoing 开发者_如何学Ccode, but what I am trying to apply as the next (visual) column group with a specific colspan in the table is starting on the broken line of the col1,2,3 Headers.

<rich:dataTable value="Some Table"> 
    <f:facet name="header">
        <rich:columnGroup>
            <rich:column colspan="3">
                <h:outputText value="ColumnGroupHead1"/>
            </rich:column>
            <rich:column breakBefore="true">
                <h:outputText value="Col 1 head"/>
            </rich:column>
            <rich:column>
                <h:outputText value="Col 2 head"/>
            </rich:column>
            <rich:column>
                <h:outputText value="Col 3 Head"/>
            </rich:column>
        <rich:column colspan="3">
                <h:outputText value="ColumnGroupHead2"/>
            </rich:column>
            <rich:column breakBefore="true">
                <h:outputText value="Col 3 head"/>
            </rich:column>
            <rich:column>
                <h:outputText value="Col 4 head"/>
            </rich:column>
            <rich:column>
                <h:outputText value="Col 5 Head"/>
            </rich:column>

        </rich:columnGroup>
    </f:facet>
     <rich:column>
        <h:outputText value="Col1 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col2 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col3 Data"/>
    </rich:column>     
    <rich:column>
        <h:outputText value="Col4 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col5 Data"/>
    </rich:column>
    <rich:column>
        <h:outputText value="Col6 Data"/>
    </rich:column>

Is it psossible to have maultiple column groups in a dataTable? When I try and close the first columnGroup and then open a new columnGroup, the iital columnGroup is not applied to the dat table.

any assistance would be appreicated.

Rory


I got this figured out. Would delete if knew how. I had my colspan ColumnGroupHEading sets out fo sequence.

<rich:dataTable value="Some Table"> 
         <f:facet name="header">        
     <rich:columnGroup>            
     <rich:column colspan="3">              
       <h:outputText value="ColumnGroupHead"/>        
     </rich:column>  
    <rich:columnGroup>

iT IS THEN THAT I SHOULD HAVE ENTERED THE NEXT COLSPAN , ColumnGroupHeading Header.

<rich:column colspan="3">              
   <h:outputText value="ColumnGroupHead2"/>        
</rich:column>  
<rich:column breakBefore="true"> 
   <h:outputText value="Col 1 head"/>
</rich:column>  

aND THEN THE COLUMN HEADINGS

<rich:column breakBefore="true">
      <h:outputText value="Col 1 head"/>    
         </rich:column>        
     <rich:column>              

     <h:outputText value="Col 2 head"/>    
         </rich:column>        
     <rich:column>              
   <h:outputText value="Col 3 Head"/>   
          </rich:column>       
<h:outputText value="Col 4 head"/>    
         </rich:column>        
     <rich:column>              

     <h:outputText value="Col 5 head"/>    
         </rich:column>        
     <rich:column>              
   <h:outputText value="Col 6 Head"/>   
          </rich:column>       


  </rich:columnGroup> 
    </f:facet>   
   <rich:column>      
   <h:outputText value="Col1 Data"/>  
   </rich:column>   
  <rich:column>         
<h:outputText value="Col2 Data"/> 
    </rich:column>     
<rich:column>      
   <h:outputText value="Col3 Data"/> 
    </rich:column>     
<rich:column>      
   <h:outputText value="Col4 Data"/>    
 </rich:column>    
 <rich:column>    
     <h:outputText value="Col5 Data"/> 
    </rich:column>   
  <rich:column>       
  <h:outputText value="Col6 Data"/>
     </rich:column>
 </rich:dataTable> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜