You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jeevan Bihari <je...@yahoo.com> on 2003/05/21 03:47:18 UTC

Contrib:Table column header

  I have a Contrib:Table that is using SimpleTableModel to construct column headers and rest of
the table data. I have a column header that says "Last Name", however, I would like it to do
something like "Last<br>Name" where Last and Name are on separate lines in the same header cell.
However, the table column renderer doesn't handle raw HTML it seems. Any ideas how to accomplish
the above rendering ? I'd hate to use ForEach for such a small issue.

Thanks,
Jeevan 

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

RE: Contrib:Table column header

Posted by Jeevan Bihari <je...@yahoo.com>.
Hi,

  Thanks for looking into this problem. 

  It seems you were the original creator of the Table and related components so just curious if
you were looking into making the default implementation accept raw HTML as the columns' display
names (in addition to the plain text it accepts now) since this would allow easy formatting of the
way the columns appear ?

Thanks,
Jeevan

--- Mind Bridge <mi...@yahoo.com> wrote:
> Hi,
> 
> 	This is easily done, but the preferred implementation depends on whether
> you use 2.3 or 2.4/3.0.
> 
> 	With 2.3:
> 
> 	Create your own column by extending SimpleTableColumn and overriding
> getColumnRenderer() to make it return your own component that will adjust
> the appearance of the column titles the way you want them. See
> SimpleTableColumn's implementation in
> net.sf.tapestry.contrib.table.model.simple as an example.
> 
> 	With 2.4/3.0:
> 
> 	Apply setColumnRendererSource(new ComponentTableRendererSource(<your
> component>)) to your column (usually after it is created). You can create a
> component that renders the column by implementing ITableRendererListener (so
> that it can be initialized). For examples have a look at
> org.apache.tapestry.contrib.table.components.inserted.
> 
> 
> 	We use custom column renderers in all our products, which allows us to
> control all aspects of how the column headers should look like, not only the
> appearance of the text.
> 
> 	In general, however, it may be a good idea to have a way to make the
> default implementation accept raw HTML as the columns' display names (in
> addition to the plain text it accepts now). This would allow easy formatting
> of the way the columns appear, e.g. in the way you've described.
> 
> 
> Best regards,
> -mb
> 
> 
> -----Original Message-----
> From: Jeevan Bihari [mailto:jeevanbihari@yahoo.com]
> Sent: Wednesday, May 21, 2003 4:47 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Contrib:Table column header
> 
> 
>   I have a Contrib:Table that is using SimpleTableModel to construct column
> headers and rest of
> the table data. I have a column header that says "Last Name", however, I
> would like it to do
> something like "Last<br>Name" where Last and Name are on separate lines in
> the same header cell.
> However, the table column renderer doesn't handle raw HTML it seems. Any
> ideas how to accomplish
> the above rendering ? I'd hate to use ForEach for such a small issue.
> 
> Thanks,
> Jeevan
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

RE: Contrib:Table column header

Posted by Mind Bridge <mi...@yahoo.com>.
Hi,

	This is easily done, but the preferred implementation depends on whether
you use 2.3 or 2.4/3.0.

	With 2.3:

	Create your own column by extending SimpleTableColumn and overriding
getColumnRenderer() to make it return your own component that will adjust
the appearance of the column titles the way you want them. See
SimpleTableColumn's implementation in
net.sf.tapestry.contrib.table.model.simple as an example.

	With 2.4/3.0:

	Apply setColumnRendererSource(new ComponentTableRendererSource(<your
component>)) to your column (usually after it is created). You can create a
component that renders the column by implementing ITableRendererListener (so
that it can be initialized). For examples have a look at
org.apache.tapestry.contrib.table.components.inserted.


	We use custom column renderers in all our products, which allows us to
control all aspects of how the column headers should look like, not only the
appearance of the text.

	In general, however, it may be a good idea to have a way to make the
default implementation accept raw HTML as the columns' display names (in
addition to the plain text it accepts now). This would allow easy formatting
of the way the columns appear, e.g. in the way you've described.


Best regards,
-mb


-----Original Message-----
From: Jeevan Bihari [mailto:jeevanbihari@yahoo.com]
Sent: Wednesday, May 21, 2003 4:47 AM
To: tapestry-user@jakarta.apache.org
Subject: Contrib:Table column header


  I have a Contrib:Table that is using SimpleTableModel to construct column
headers and rest of
the table data. I have a column header that says "Last Name", however, I
would like it to do
something like "Last<br>Name" where Last and Name are on separate lines in
the same header cell.
However, the table column renderer doesn't handle raw HTML it seems. Any
ideas how to accomplish
the above rendering ? I'd hate to use ForEach for such a small issue.

Thanks,
Jeevan

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org