Re: translators in 5.2+

2011-01-11 Thread Paul Stanton
ah that's better :) and i now have arithmetic support in my text fields .. jeez shunting-yard/rpn/infix/postfix blah blah is a pain and now that i have a method that works i hope i never have to look at it all again!!! p. On 11/01/2011 9:15 AM, Josh Canfield wrote: Have you tried : configu

Re: translators in 5.2+

2011-01-10 Thread Josh Canfield
Have you tried : configuration.override(BigDecimal.class, new BigDecimalTranslator()); Josh On Mon, Jan 10, 2011 at 2:01 PM, Paul Stanton wrote: > can someone shed some light on how to override or supply new translators to > tapestry 5.2+ ? > > jumpstart is written for 5.1 > http://jumpstart.do

translators in 5.2+

2011-01-10 Thread Paul Stanton
can someone shed some light on how to override or supply new translators to tapestry 5.2+ ? jumpstart is written for 5.1 http://jumpstart.doublenegative.com.au/jumpstart/examples/input/creatingtranslators1 and no longer works. i've tried adding: public static void contributeTranslatorSou

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