Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: joda LocalDate and D2W?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: joda LocalDate and D2W?



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

References: 
 >joda LocalDate and D2W? (From: Henrique Gomes <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.