Right, I wasnt aware that the contribute methods need to be placed in AppModule.java in order to be discovered by Tapestry. That seems to be the issue.
Thanks. rkalsi wrote: > > I have written a BigDecimal translator which converts String -> > BigDecimal, but It doesnt seem to work. > > In my class, I have added the following: > > public static void contributeTranslatorDefaultSource( > MappedConfiguration<Class, Translator> configuration) { > configuration.add(BigDecimal.class, new BigDecimalTranslator()); > } > public static void contributeTranslatorSource( > MappedConfiguration<String, Translator> configuration) { > configuration.add("bigdecimal", new BigDecimalTranslator()); > } > > public static void > contributeTypeCoercer(Configuration<CoercionTuple> configuration) { > Coercion<String, BigDecimal> to = new Coercion<String, BigDecimal>() > { > public BigDecimal coerce(String input) { > return new BigDecimal(input); > } > }; > > Coercion<BigDecimal, String> from = new Coercion<BigDecimal, > String>() { > public String coerce(BigDecimal input) { > return input.toString(); > } > }; > > configuration.add(new CoercionTuple<String, BigDecimal>(String.class, > BigDecimal.class, to)); > configuration.add(new CoercionTuple<BigDecimal, > String>(BigDecimal.class, String.class, from)); > } > > > any ideas what might be going wrong ? This translator doesnt seem to > register itself. > > --Thanks. > -- View this message in context: http://www.nabble.com/Getting-BigDecimal-Translator-to-work-tf4737073.html#a13584821 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]