With a bit of testing I figured most of it out 

I use the coerction below to convert from Long to Local when the event is
fire

        configuration.add(new CoercionTuple<Long, LocalDate>(Long.class,
LocalDate.class,
                new Coercion<Long, LocalDate>() {
                    @Override
                    public LocalDate coerce(Long input) {
                        return new LocalDate(input);
                    }
                }));

and this to be able to display LocalDate (Joda time) 

        configuration.add(new CoercionTuple<LocalDate,
String>(LocalDate.class, String.class,
                new Coercion<LocalDate, String>() {
                    @Override
                    public String coerce(LocalDate input) {
                        return String.valueOf(input.toDate().getTime());
                    }
                }));

using the t:context="lodaDate" in the eventlink.

So my last question is if I dont proviede Coerection from LocalDate ->
String then the toString method is called on the localDate, right? Which
would explain why without the given coercion on I only get 2012-10-10
instead of long representation of the date.




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Type-Coercer-for-Joda-Time-tp5717942p5717958.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to