You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Valdemaras Repšys <de...@gmail.com> on 2006/01/21 16:35:37 UTC
How to format a data in table component cells?
Hi,
I'm new to Tapestry, just made a table using the contrib table
component. The data source to the table is a List of beans taken
straight from the SQL Database, columns include timestamps. And in the
date column full date is shown like this: 2006-01-01 00:00:00.0. I want
it to be: 2006-01-01
What is the easiest or the best way to format the date and other columns
using table component?
I find it a bit cumbersome to format the source itself, because I would
need one more class for bean special formatting code and other
troubles:]
Thank you in advance,
Valdemaras
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: How to format a data in table component cells?
Posted by Mind Bridge <mi...@yahoo.com>.
There have been many threads on this topic, one of the latest ones being
"Howto format date values within contrib:Table?". I would suggest to do
a search in the archives.
One of the suggestions in the emails was the following:
Something like this in the html template:
<span jwcid="accessTimeColumnValue@Block">
<span jwcid="@Insert"
value="ognl:dataRow.accessTime"
format="ognl:dateFormater" />
</span>
In your page specification file :
<property name="dateFormater"
initial-value="new java.text.SimpleDateFormat('EEE, d MMM yy HH:mm')"/>
where accessTime is column ID.
Valdemaras Repšys wrote:
> Hi,
>
> I'm new to Tapestry, just made a table using the contrib table
> component. The data source to the table is a List of beans taken
> straight from the SQL Database, columns include timestamps. And in the
> date column full date is shown like this: 2006-01-01 00:00:00.0. I want
> it to be: 2006-01-01
>
> What is the easiest or the best way to format the date and other columns
> using table component?
>
> I find it a bit cumbersome to format the source itself, because I would
> need one more class for bean special formatting code and other
> troubles:]
>
> Thank you in advance,
> Valdemaras
>
>
> ---------------------------------------------------------------------
> 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