You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ted Steen <te...@gmail.com> on 2007/08/18 13:05:11 UTC
T5: different translator behaviour for same component
Hi,
The date picker component im working on atm have a selectable date
format which should be parsed and formatted by the translator.
The date format is passed to the date picker via a parameter, problem
is that the translator is defined in the app module and I dont know
how to get the information about the date format to the translator.
Any ideas?
--
/ted
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5: different translator behaviour for same component
Posted by Josh Canfield <jo...@thedailytube.com>.
Hi Ted,
I could be totally wrong, (I just did code inspection, no debugging) but
looking at the TranslatorSource
http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/internal/services/TranslatorSourceImpl.html
or
http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/src-html/org/apache/tapestry/internal/services/TranslatorDefaultSourceImpl.html
It doesn't look like new instances of the translator are getting created per
request. That would imply to me that setting data into them would be a bad
thing.
A couple of approaches that you could use:
1. Configure your date picker in the appmodule to add supported
formats. Then iterate over the formats until you find one that works.
2. Don't use a translator, accept the format as a parameter and do the
date->string->date conversion yourself.
Josh
On 8/21/07, Ted Steen <te...@gmail.com> wrote:
>
> Is this a stupid question or is it just hard to answer?
> (bump...)
>
> 2007/8/18, Ted Steen <te...@gmail.com>:
> > Hi,
> >
> > The date picker component im working on atm have a selectable date
> > format which should be parsed and formatted by the translator.
> > The date format is passed to the date picker via a parameter, problem
> > is that the translator is defined in the app module and I dont know
> > how to get the information about the date format to the translator.
> >
> > Any ideas?
> > --
> > /ted
> >
>
>
> --
> /ted
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.
Re: T5: different translator behaviour for same component
Posted by Ted Steen <te...@gmail.com>.
Is this a stupid question or is it just hard to answer?
(bump...)
2007/8/18, Ted Steen <te...@gmail.com>:
> Hi,
>
> The date picker component im working on atm have a selectable date
> format which should be parsed and formatted by the translator.
> The date format is passed to the date picker via a parameter, problem
> is that the translator is defined in the app module and I dont know
> how to get the information about the date format to the translator.
>
> Any ideas?
> --
> /ted
>
--
/ted
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org