You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Kuhn, Harald" <HK...@airplus.com> on 2007/10/29 13:04:31 UTC

[Trinidad]: multiline table rows with nested - 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:	  HKuhn@airplus.com
Internet:  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
> 
> 

Re: [Trinidad]: multiline table rows with nested - Tags

Posted by "max.starets" <Ma...@oracle.com>.
Harald,

Have you tried using non-nested columns and rendering a break (<br>) between
the lines?
Column component can contain several indexed children.
Note that nesting columns makes sense only if you want to group columns in
the header.

Regards,

Max Satrets


Kuhn, Harald wrote:
> 
> 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  element in a <table> element.
> 2007-10-29 13:00:26,906   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  element in a <table> element.
> 2007-10-29 13:00:26,906   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  element in a <tr> element.
> 2007-10-29 13:00:26,906   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  element in a <tr> element.
> 2007-10-29 13:00:26,906   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  element in a <table> element.
> 2007-10-29 13:00:26,906   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  element in a <table> element.
> 2007-10-29 13:00:26,906   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  element in a <tr> element.
> 2007-10-29 13:00:26,921   WARN 
> org.apache.myfaces.trinidadinternal.io.DebugHtmlResponseWriter: Illegal
> HTML: cannot put a  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:	  HKuhn@airplus.com
> Internet:  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
>> 
>> 
> 
>  
>  
>  
> 

-- 
View this message in context: http://www.nabble.com/-Trinidad-%3A-multiline-table-rows-%3Ctr%3Atable%3E-with-nested-%3Ctr%3Acolumn%3E---Tags-tf4711254.html#a13516018
Sent from the MyFaces - Users mailing list archive at Nabble.com.