You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Marco_Coder <jr...@yahoo.com> on 2006/10/03 15:38:22 UTC

Re: SV: Hierarchial Column Labels

Hi Morten,

I hope you share your answer, I've played with the widget and I'm unable to
'add' a row to the header. I now know how to embedded columns and datatables
with in columns, but I've yet to figure out how to add a row to the header
it self.

Thanks,

MC


Morten Mortensen wrote:
> 
> 
> I can do it - with <t:columns> and one additional row of headers with
> colspan>1 for each header-field. It was not easy, it took some time -
> and it looks good.
> 
> You know - if you are willing to pay, then someone might ask you "how
> much" :-)
> 
> Visual example in the form of a PNG-bitmap is attached.
> 
>      ----
> 
> It would be really, really nice to have this "hierarcical header"
> functionality build into MyFaces/JSF or at least a custom
> HTML-extended-table-renderer. A renderer capable of parsing a
> column-header tree-structure with the leaves first corresponding to the
> lower-most header-row and then going up to the tree-root joining both
> headers into super-headers coreesponding to parent-nodes and with
> "colspan>1" and even "rowspan>1" if levels are missing... You get the
> idea. This is of course possible.
> 
> Regards
> Morten Sabroe Mortensen
> 
> 
> -----Oprindelig meddelelse-----
> Fra: Marco_Coder [mailto:jr_furman@yahoo.com] 
> Sendt: 27. september 2006 19:50
> Til: users@myfaces.apache.org
> Emne: Hierarchial Column Labels
> 
> 
> |            Hier1             |            Hier2            |          
> Hier3          |
> ------------------------------------------------------------------------
> ------------------------
> |   Label1   |    Label2   |   Label3   |   Label4   |   Label5  |
> Label6
> |
> ------------------------------------------------------------------------
> ------------------------
> |   100       |     -1        |  Blue       | Strings    |   $100    |
> 
> %90   |
> 
> I can create a dataTable with the last 2 rows, but not sure how to
> create
> one with the first row as well, so that a label may cover 2 columns such
> as
> the Hier1 label.
> 
> Any help would be great! P.S. I'm willing to pay for an answer!
> 
> Thanks,
> 
> MC
> -- 
> View this message in context:
> http://www.nabble.com/Hierarchial-Column-Labels-tf2346303.html#a6531809
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/Hierarchial-Column-Labels-tf2346303.html#a6620334
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: SV: Hierarchial Column Labels

Posted by Marco_Coder <jr...@yahoo.com>.
Here is a solution, hard coded. One would just have to set up a backing bean
to create the header via the model at hand. I'm not sure why I hadn't tried
this earlier, I was look for wdgets vs generating the HTML myself.

<t:dataTable id="table2" value="#{testColspanBean.lines}" var="line"
						rowClasses="standardTable_Row1,standardTable_Row2"
	            
columnClasses="standardTable_Column,standardTable_ColumnCentered"
	            	styleClass="standardTable" headerClass="standardTable_Header"
footerClass="standardTable_Header" title="Title Row" >
						<f:facet name="header">
							
								<f:verbatim escape="false">
										<TR>
											<TH colspan="5" class="standardTable_Header" align="center">Top
Hier</TH>
										</TR>
										<TR>
											<TH colspan="3" class="standardTable_Header" align="center">Hier
1</TH>
											<TH colspan="2" class="standardTable_Header" align="center">Hier
2</TH>						
										</TR>										
								</f:verbatim>
						</f:facet>
						<t:column>
							<f:facet name="header">
								<f:verbatim escape="false">head 1</f:verbatim>
							</f:facet>
							<f:facet name="footer">
								<f:verbatim escape="false">foot 1</f:verbatim>
							</f:facet>
							<h:outputText value="#{line.col1}" />
						</t:column>
						<t:column>
							<f:facet name="header">
								<f:verbatim escape="false">head 2</f:verbatim>
							</f:facet>
							<f:facet name="footer">
								<f:verbatim escape="false">foot 2</f:verbatim>
							</f:facet>
							<h:outputText value="#{line.col2}" />
						</t:column>
						<t:column >
							<f:facet name="header">
								<f:verbatim escape="false">head 3</f:verbatim>
							</f:facet>
							<f:facet name="footer">
								<f:verbatim escape="false">foot 3</f:verbatim>
							</f:facet>
							<h:outputText value="#{line.col3}" />
						</t:column>
						<t:column>
							<f:facet name="header">
								<f:verbatim escape="false">head 4</f:verbatim>
							</f:facet>
							<f:facet name="footer">
								<f:verbatim escape="false">foot 4</f:verbatim>
							</f:facet>
							<h:outputText value="#{line.col4}" />
						</t:column>
						<t:column>
							<f:facet name="header">
								<f:verbatim escape="false">head 5</f:verbatim>
							</f:facet>
							<f:facet name="footer">
								<f:verbatim escape="false">foot 5</f:verbatim>
							</f:facet>
							<h:outputText value="#{line.col5}" />
						</t:column>
					</t:dataTable>



Marco_Coder wrote:
> 
> Hi Morten,
> 
> I hope you share your answer, I've played with the widget and I'm unable
> to 'add' a row to the header. I now know how to embedded columns and
> datatables with in columns, but I've yet to figure out how to add a row to
> the header it self.
> 
> Thanks,
> 
> MC
> 
> 
> Morten Mortensen wrote:
>> 
>> 
>> I can do it - with <t:columns> and one additional row of headers with
>> colspan>1 for each header-field. It was not easy, it took some time -
>> and it looks good.
>> 
>> You know - if you are willing to pay, then someone might ask you "how
>> much" :-)
>> 
>> Visual example in the form of a PNG-bitmap is attached.
>> 
>>      ----
>> 
>> It would be really, really nice to have this "hierarcical header"
>> functionality build into MyFaces/JSF or at least a custom
>> HTML-extended-table-renderer. A renderer capable of parsing a
>> column-header tree-structure with the leaves first corresponding to the
>> lower-most header-row and then going up to the tree-root joining both
>> headers into super-headers coreesponding to parent-nodes and with
>> "colspan>1" and even "rowspan>1" if levels are missing... You get the
>> idea. This is of course possible.
>> 
>> Regards
>> Morten Sabroe Mortensen
>> 
>> 
>> -----Oprindelig meddelelse-----
>> Fra: Marco_Coder [mailto:jr_furman@yahoo.com] 
>> Sendt: 27. september 2006 19:50
>> Til: users@myfaces.apache.org
>> Emne: Hierarchial Column Labels
>> 
>> 
>> |            Hier1             |            Hier2            |          
>> Hier3          |
>> ------------------------------------------------------------------------
>> ------------------------
>> |   Label1   |    Label2   |   Label3   |   Label4   |   Label5  |
>> Label6
>> |
>> ------------------------------------------------------------------------
>> ------------------------
>> |   100       |     -1        |  Blue       | Strings    |   $100    |
>> 
>> %90   |
>> 
>> I can create a dataTable with the last 2 rows, but not sure how to
>> create
>> one with the first row as well, so that a label may cover 2 columns such
>> as
>> the Hier1 label.
>> 
>> Any help would be great! P.S. I'm willing to pay for an answer!
>> 
>> Thanks,
>> 
>> MC
>> -- 
>> View this message in context:
>> http://www.nabble.com/Hierarchial-Column-Labels-tf2346303.html#a6531809
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> 
>> 
>>  
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Hierarchial-Column-Labels-tf2346303.html#a6622277
Sent from the MyFaces - Users mailing list archive at Nabble.com.