LocalDate and D2W redux
LocalDate and D2W redux
- Subject: LocalDate and D2W redux
- From: Paul Hoadley <email@hidden>
- Date: Tue, 12 Jun 2012 20:48:46 +0930
Hello,
Back in December 2011, in this thread:
http://lists.apple.com/archives/webobjects-dev/2011/Dec/msg00440.html
Ramsey described a method for binding an ERXJodaLocalTimeFormatter to (I assume) an ERD2WEditString component with this rule:
> 10 : ((smartAttribute.valueFactoryMethod != null and smartAttribute.factoryMethodArgumentType = 3) and smartAttribute.className = 'org.joda.time.LocalTime') => formatObject = {"arguments" = ({"className" = "java.lang.String"; "contextKey" = "formatter"; }, {"className" = "java.util.Locale"; "contextKey" = "session.localizer.@locale"; }, {"className" = "java.util.TimeZone"; "contextKey" = "session.timeZone"; }); "className" = "er.extensions.formatters.ERXJodaLocalTimeFormatter"; } [ERDDelayedObjectCreationAssignment]
Firstly, is that still the state of the art, or is there a better way to do it now? Secondly, Ramsey, should that work just as well substituting 'org.joda.time.LocalDate' and 'er.extensions.formatters.ERXJodaLocalDateFormatter' above? Both questions arise because that's what I've tried, and I cannot get it to work for the life of me. Specifically, I have these rules:
100 : (entity.name = 'Invoice' and propertyKey = 'invoiceDate') => componentName = "ERD2WEditString" [com.webobjects.directtoweb.Assignment]
50 : ((smartAttribute.valueFactoryMethod != null and smartAttribute.factoryMethodArgumentType = 3) and smartAttribute.className = 'org.joda.time.LocalDate') => formatObject = {"arguments" = ({"className" = "java.lang.String"; "contextKey" = "formatter"; }, {"className" = "java.util.Locale"; "contextKey" = "session.localizer.@locale"; }, {"className" = "java.util.TimeZone"; "contextKey" = "session.timeZone"; }); "className" = "er.extensions.formatters.ERXJodaLocalDateFormatter"; } [ERDDelayedObjectCreationAssigment]
100 : (entity.name = 'Invoice' and propertyKey = 'invoiceDate') => formatter = "d2wContext.formatObject" [com.webobjects.directtoweb.Assignment]
Yet there's no 'formatter' binding when I hover over the invoiceDate field, and I continue to get an exception complaining about not having a formatter.
--
Paul Hoadley
http://logicsquad.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden