Nice. Why don't you post the code on a new page here? ... http://wiki.apache.org/tapestry/Tapestry5HowTos
Cheers, Nick. Ognen Ivanovski wrote: > > > On 2007-08-16, at 05:10, Nick Westgate wrote: > >> Indeed. Hence the JIRA. >> >> Howard has mentioned the possibility of merging the two type >> coercion systems. > > That Would be great! > > What I currently do to seamlessly use Entities across the framework > (activation / deactivation, parameters, RadioGroup / Radio: > > - I have a service > > public interface EntityCoercionConfigurator { > > void configureEntityCoercions(Configuration<CoercionTuple<?, ?>> > configuration); > void configureEntityValueEncoders(MappedConfiguration<Class, > ValueEncoderFactory> configuration); > > Which discovers all registered Entities (JPA, Hibernate). > > It is then used in > > public void contributeTypeCoercer( > @Inject EntityCoercionConfigurator configurator, > Configuration<CoercionTuple> configuration) { > configurator.configureEntityCoercions(configuration); > } > > This gives me the String -> Entity and Entity -> String coercions I > need. So far so good! > > What I don't like is that I also have to > > public void contributeValueEncoderSource( > @Inject EntityCoercionConfigurator configurator, > MappedConfiguration<Class, ValueEncoderFactory> configuration) { > configurator.configureEntityValueEncoders(configuration); > } > > Which currently instantates a ValueEncoderFactory that produces just > one ValueEncoder that routes all toClient() and toValue() calls to > the type coercer. > > This is not that bad but I'd like to leave out the second step. :) > > P.S. It might be good that such code finds it's place in tapestry- > hibernate. I'd be glad to contribute it if there is interest for that. > > Cheers, > Ognen > > -- > Ognen Ivanovski | [EMAIL PROTECTED] > phone +389 -2- 30 64 532 | fax +389 -2- 30 79 495 > Netcetera | 1000 Skopje | Macedonia | http://netcetera.com.mk > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5-Type-to-ValueEncoderFactory-tf4264856.html#a12277427 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]