Re: LocalDate and D2W redux
Re: LocalDate and D2W redux
- Subject: Re: LocalDate and D2W redux
- From: Ramsey Gurley <email@hidden>
- Date: Tue, 12 Jun 2012 08:08:34 -0700
The component I'm using isn't in wonder. Have a look at R2D2WEditDate.
https://github.com/nullterminated/ponder/tree/master/ERR2d2w
Ramsey
On Jun 12, 2012, at 4:18 AM, Paul Hoadley wrote:
> 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
_______________________________________________
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