Re: translators in 5.2, and re-use as formatters

2010-12-26 Thread Josh Canfield
> How do I associate more than one Translator to a type? I think TranslatorAlternatesSource is what you want. It allows you to specify translators by name and they can overlap types. http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/services/TranslatorAlternatesSource.html

Re: translators in 5.2, and re-use as formatters

2010-12-26 Thread Thiago H. de Paula Figueiredo
On Fri, 24 Dec 2010 02:19:58 -0200, Paul Stanton wrote: If no one can tell me what existing tapestry concept I'm missing I may spend some time seeing if I can write some code to get this going. Why don't you create a simple component that receives a Translator and the value to be output

Re: translators in 5.2, and re-use as formatters

2010-12-24 Thread Benny Law
Hi Paul, I share your view on this topic. Some time ago, I was struggling a bit with trying to control the precise formatting of numeric fields, and I eventually had to create a new translator with a new binding. The toClient() method of the translator takes care of the required formatting specifi

Re: translators in 5.2, and re-use as formatters

2010-12-23 Thread Paul Stanton
Thanks Bryan, Yes it seems this is some functionality that has been victim of some other architectural concept. This is confusing and disappointing to me - I see it as a key facility that should be provided by the framework since one of the key tasks (you could argue "the key task") of web a

Re: translators in 5.2, and re-use as formatters

2010-12-22 Thread Bryan Lewis
I don't have a great answer, but since you asked again... I had a similar surprise a year ago because I was expecting things to work as they did in Tap4: http://www.mail-archive.com/users@tapestry.apache.org/msg39593.html But someone (Thiago probably) pointed out that it wasn't so hard to specify

Re: translators in 5.2, and re-use as formatters

2010-12-21 Thread Paul Stanton
anyone? On 5/12/2010 10:59 AM, Paul Stanton wrote: Hi Thiago, If I want a way to make commonly used translators (and formatters) available to every component I can: 1. create a service and inject it into every component class and mark it a property 2. create my own binding prefix am i mi

Re: translators in 5.2, and re-use as formatters

2010-12-04 Thread Paul Stanton
Hi Thiago, If I want a way to make commonly used translators (and formatters) available to every component I can: 1. create a service and inject it into every component class and mark it a property 2. create my own binding prefix am i missing something ? I would expect this to be easier, i

Re: translators in 5.2, and re-use as formatters

2010-12-04 Thread Thiago H. de Paula Figueiredo
On Sat, 04 Dec 2010 12:13:02 -0200, Paul Stanton wrote: I also can't find any documentation regarding the config of Translators ... ? The contribution for TranslatorSource defines the default translator. If you want to use another one, just pass it to the translator parameter. You'll p

Re: translators in 5.2, and re-use as formatters

2010-12-04 Thread Paul Stanton
I also can't find any documentation regarding the config of Translators ... ? On 2/12/2010 11:53 PM, Paul Stanton wrote: Hi, in 5.0 you used to be able to define and refer to Translators by name: public static void contributeTranslatorSource(Configuration configuration) { co

translators in 5.2, and re-use as formatters

2010-12-02 Thread Paul Stanton
Hi, in 5.0 you used to be able to define and refer to Translators by name: public static void contributeTranslatorSource(Configuration configuration) { configuration.add(new MyTranslator("Decimal")); configuration.add(new MyTranslator("Decimal2Dp")); } I could then