Hi Harald,

I don't know anything about the tr:table component, but I know that neither the 
standard h:dataTable nor the tomahawk t:dataTable will support this. They are 
strictly one row per object.

In a case like this where you need such strict layout control, I would suggest 
you investigate using tomahawk's t:dataList (or the trinidad equivalent). You 
would need to explicitly add html tags to output the table header, footer, and 
column definitions, because t:dataList doesn't handle that as the table 
components do. However you can then use t:dataList to loop over your list of 
objects outputting whatever you want for each object (including multiple TR 
tags). It's not as elegant, but gives more control.

Are the contents of the table read-only? Hopefully so. The table components do 
make significant effort to make sure that input components work fine within 
rows of a table; not sure what t:dataList does in this case. If you do have 
input components in there, then at the least you should probably wrap the 
t:dataList in an f:subview tag to minimise problems with component id conflicts.

Regards,

Simon

---- "Kuhn schrieb:
> Hi to all, 
>  
> as this is a "must-have" for our application, it would be great, if someone 
> could investigate this topic.
> Aside from the example in the screenshot, colspan should also be handeled 
> correctly.
> And each column should be sortable:
>  
> For Example a structure like:
> header row 1:     |Header 1.1 (colspan=2)                        |Header 1.2 
> (colspan=1)|
> header row 2:     |Header 2.1 (colspan=1) |Header 2.2 (colspan=1)|Header 2.3 
> (colspan=1)|
>  
> 1st data row 1:   |Data 1.1 .....................................|Data 1.2 
> .............|
> 1st data row 2:   |Data 2.1 ..............|Data 2.2 .............|Data 2.3 
> .............|
>  
> 2nd data row 1:   |Data 1.1 .....................................|Data 1.2 
> .............|
> 2nd data row 2:   |Data 2.1 ..............|Data 2.2 .............|Data 2.3 
> .............|
> (...)
>  
> As I am a newbie to JSF and Trinidad any help would be great.
>  
> Thanks
>  
>   Harald
>  
> ************************************** 
> Harald Kuhn 
> AirPlus International 
> Business Information Services 
> Phone:   +49 (0) 61 02 204-821 
> Fax:     +49 (0) 61 02 204-139 
> E-Mail:   [EMAIL PROTECTED] 
> Internet:   <http://www.airplus.com/> www.airplus.com 
> ************************************** 
> 
> 
> 
> Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 
> Neu-Isenburg · Deutschland · Geschäftsführer: Patrick W. Diemer (Vorsitz), 
> Klaus Busch · Vorsitzender des Aufsichtsrates: Stephan Gemkow · 
> Handelsregister: Amtsgericht Offenbach/Main, HRB 8119  
> 
> -----Original Message-----
> From: Kuhn, Harald [mailto:[EMAIL PROTECTED] 
> Sent: Monday, October 29, 2007 1:05 PM
> To: MyFaces Discussion
> Subject: [Trinidad]: multiline table rows <tr:table> with nested <tr:column> 
> - Tags
> 
> 
> 
> Hi, 
> 
> we are trying build a table, where each logical row (from the Backing bean) 
> is displayed as 2 rows in HTML output. 
> So the result should look similar to this image (from our struts-application, 
> we want to migrate to JSF): 
> Picture (Device Independent Bitmap) 
> 
> What I tried to to is to use a <tr:table> + nested <tr:column> - Tags 
> i.e. 
> <tr:document xmlns:ui="http://java.sun.com/jsf/facelets"; 
>         xmlns:h="http://java.sun.com/jsf/html"; 
>         xmlns:f="http://java.sun.com/jsf/core"; 
>         xmlns:tr="http://myfaces.apache.org/trinidad"; title="Multiline 
> Table"> 
> 
>         <tr:form> 
>           <tr:table value="#{dynamicTable.data}" 
>                     var="tableRow" 
>                     varStatus="tableStatus" 
>                     rowBandingInterval="1" 
>                     rows="3" 
>                     noWrap="true" 
>                   sortable="true"> 
>             <tr:column sortable="true" 
>                          noWrap="true" 
>                          sortProperty="kategorie" 
>                            defaultSortOrder="ascending"> 
>                 <f:facet name="header"> 
>                    <tr:outputText value="1. and 2. column (sort= Kategorie)" 
> /> 
>                 </f:facet> 
>                 
>                 <tr:column sortable="true" noWrap="true" 
>                           sortProperty="kategorie" 
>                           defaultSortOrder="ascending"> 
>                   <f:facet name="header"> 
>                    kategorie 
>               </f:facet> 
> 
>                 <tr:outputText value="#{tableRow['kategorie']}" /> 
>             </tr:column> 
>                                 
>                 <tr:column sortable="true" noWrap="true" 
>                            sortProperty="transaktionen" 
>                            defaultSortOrder="ascending"> 
>                   <f:facet name="header"> 
>                    transaktionen 
>               </f:facet> 
> 
>                   <tr:outputText value="#{tableRow['transaktionen']}" /> 
>                 </tr:column> 
>                 
>             <tr:outputText value="#{tableRow['kategorie']}" /> 
>             </tr:column> 
>                         
>             <tr:column sortable="true" noWrap="true" 
>                          sortProperty="transaktionen" 
>                          defaultSortOrder="ascending"> 
>                 <f:facet name="header"> 
>                   <tr:outputText value="3. Spalte (sort = transaktionen)" /> 
>                 </f:facet> 
> 
>                 <tr:column sortable="true" noWrap="true" 
>                            sortProperty="betragCompanyAccount" 
>                            defaultSortOrder="ascending"> 
>                   <f:facet name="header"> 
>                    Betrag CA 
>               </f:facet> 
>                   
>               <tr:outputText value="#{tableRow['betragCompanyAccount']}" /> 
>                 </tr:column> 
>                 
>             <tr:outputText value="#{tableRow['transaktionen']}" /> 
>           </tr:column> 
>         </tr:table> 
>   </tr:form> 
> </tr:document> 
> 
> #{dynamicTable.data} returns just a list of Beans (public final 
> List<AirlineBean> getData()) 
> 
> Unfortunatly, only the header -facets are rendered as I would expect. But, 
> the data rows not. 
> 
> The output (after the first paging request) in different browsers look as 
> followed: 
> FF 2.0: 
> Picture (Device Independent Bitmap) 
> 
> IE7: 
> Picture (Device Independent Bitmap) 
> Logging says: 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <table> element.
> 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <table> element.
> 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <tr> element.
> 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <tr> element.
> 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <table> element.
> 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <table> element.
> 
> 2007-10-29 13:00:26,906   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <tr> element.
> 
> 2007-10-29 13:00:26,921   WARN  
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal HTML: 
> cannot put a <span> element in a <tr> element.
> 
> As it is allowed to nest <tr:column>-Tags, I would expect this to work. Am I 
> doing something wrong? 
> This feature is essential for our application, therefore any help would be 
> great. 
> 
> ENV: 
>         MyFaces 1.2.1-SNAP 
>         Trinindad 1.2.3 
>         Facelets  1.1.14 
> 
> Kind regards 
> 
>   Harald 
> 
> ************************************** 
> Harald Kuhn 
> AirPlus International 
> Business Information Services 
> Phone:   +49 (0) 61 02 204-821 
> Fax:     +49 (0) 61 02 204-139 
> E-Mail:   [EMAIL PROTECTED] 
> Internet:   <http://www.airplus.com> www.airplus.com 
> ************************************** 
> 
> 
> 
> Lufthansa AirPlus Servicekarten GmbH · Hans-Böckler-Straße 7 · 63263 
> Neu-Isenburg · Germany · Geschäftsführer: Patrick W. Diemer (Vorsitz), Lutz 
> Logemann · Vorsitzender des Aufsichtsrates: Stephan Gemkow · Handelsregister: 
> Amtsgericht Offenbach/Main, HRB 8119
> 
> 

Reply via email to