Re: joda LocalDate and D2W?
Re: joda LocalDate and D2W?
- Subject: Re: joda LocalDate and D2W?
- From: Ramsey Gurley <email@hidden>
- Date: Thu, 29 Dec 2011 13:36:04 -0700
Somewhere on my todo list.
I use an edit string component with a formatter bound to d2wContext.formatObject. Then in a rule I do:
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]
This works great... as long as you don't have a format exception :-)
I need to update it to do the formatting in validateTakeValueForKeypath the way ERD2WEditNumber works.
Ramsey
On Dec 29, 2011, at 12:12 PM, Henrique Gomes wrote:
>
>
> Hello,
>
> So what are people using on D2W edit pages for jodaLocalDate fields?
> For display, a simple ERD2WEditString will do it, although I don't think I can can apply a custom format then.
> But for editing all the (ER)D2EEditDate* that I find want a string for format. I wanted a formatter object to create the jodaLocalDate from the string and the other way around.
>
> Do I have to roll my own component, patch one of the existing components or is there a simpler solution?
>
> Many thanks.
>
> Henrique Gomes
>
> _______________________________________________
> 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