My guess is the formatter string is bad/wrong. Probably defaulting to a
NSTimestamp style formatter instead of a SimpleDateFormat type of formatter.
Try adding something like:
25 : ((smartAttribute.className = 'com.webobjects.foundation.NSTimestamp' or
(smartAttribute.valueFactoryMethod != null and
smartAttribute.factoryMethodArgumentType = 3)) and (smartAttribute.valueType =
'D' or smartAttribute.valueType = 'M')) => formatter = "MM/dd/yyyy" [Assignment]
If that doesn't work, set a breakpoint in the formatter method on
ERXJodaLocalDateFormatter to see what pattern string is causing the problem.
Ramsey
On Jul 30, 2012, at 11:21 AM, Paul Yu wrote:
> Ramsey
>
> I think I added your rule correctly, but of course it is not as I'm getting
> this. Any ideas?
>
> Paul
>
>
> Jul 30 14:19:28 FarmManager[55773] INFO er.r2d2w.components.R2D2WEditDate
> (InspectFMFarmHouseFlock) - Date is 2011-02-01
> Jul 30 14:19:28 FarmManager[55773] INFO er.r2d2w.components.R2D2WEditDate
> (InspectFMFarmHouseFlock) - Date Format is
> er.extensions.formatters.ERXJodaLocalDateFormatter@43c32b82
> Jul 30 14:19:28 FarmManager[55773] WARN NSLog (InspectFMFarmHouseFlock) -
> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception
> occurred while handling request:
> java.lang.IllegalArgumentException: Invalid pattern specification
> [2012-7-30 14:19:28 EDT] <WorkerThread0> java.lang.IllegalArgumentException:
> Invalid pattern specification
> at
> org.joda.time.format.DateTimeFormat.createFormatterForPattern(DateTimeFormat.java:675)
> at
> org.joda.time.format.DateTimeFormat.forPattern(DateTimeFormat.java:170)
> at
> er.extensions.formatters.ERXJodaLocalDateFormatter.formatter(ERXJodaLocalDateFormatter.java:52)
> at
> er.extensions.formatters.ERXJodaLocalDateFormatter.format(ERXJodaLocalDateFormatter.java:62)
> at java.text.Format.format(Format.java:140)
> at
> er.r2d2w.components.R2D2WEditDate.appendToResponse(R2D2WEditDate.java:46)
> at
> com.webobjects.appserver._private.WOComponentReference.appendToResponse(WOComponentReference.java:135)
> at
> er.extensions.components._private.ERXSwitchComponent.appendToResponse(ERXSwitchComponent.java:132)
> at
> com.webobjects.appserver._private.WOComponentContent.appendToResponse(WOComponentContent.java:51)
> at
> com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:1122)
> at
> com.webobjects.appserver._private.WOComponentReference.appendToResponse(WOComponentReference.java:135)
> at
> com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
> at
> com.webobjects.appserver._private.WOGenericContainer.appendToResponse(WOGenericContainer.java:44)
> at
> com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
> at
> com.webobjects.appserver._private.WOGenericContainer.appendToResponse(WOGenericContainer.java:44)
> at
> com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
> at
> er.extensions.components._private.ERXWORepetition.appendToResponse(ERXWORepetition.java:583)
> at
> com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
> at
> com.webobjects.appserver._private.WOGenericContainer.appendToResponse(WOGenericContainer.java:44)
> at
> com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
> at
> er.extensions.components._private.ERXWORepetition.appendToResponse(ERXWORepetition.java:583)
> at
> com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
> at
> com.webobjects.appserver._private.WOGenericContainer.appendToResponse(WOGenericContainer.java:44)
> at
> com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:1122)
> at
> er.extensions.components.ERXComponent.appendToResponse(ERXComponent.java:117)
> at
> er.extensions.components.ERXNonSynchronizingComponent.appendToResponse(ERXNonSynchronizingComponent.java:73)
> at
> er.directtoweb.components.ERDCustomComponent.appendToResponse(ERDCustomComponent.java:302)
> at
> er.directtoweb.components.repetitions.ERDAttributeRepetition.appendToResponse(ERDAttributeRepetition.java:118)
>
>
>
> On Jul 30, 2012, at 12:49 PM, Ramsey Gurley wrote:
>
>>
>> On Jul 30, 2012, at 5:52 AM, Paul Yu wrote:
>>
>>> Ramsey
>>>
>>> So I'm trying to use you R2 stuff. There are lots of errors in the
>>> project, even after I switched to the integration branch.
>>
>> I think there's some stuff I haven't checked in that's in progress. Or I
>> just forgot. I'll have to look again.
>>
>> I just got my first android and it has been taking up most of my free geek
>> time lately :-)
>>
>>>
>>> How do I specify the formatObject in the rule?
>>
>> Just go into ERR2D2W/Resources/d2w.d2wmodel and search it for formatObject.
>> Here's the one for joda LocalDate
>>
>> 10 : ((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"; }
>> [ERDDelayedObjectCreationAssignment]
>>
>> It uses the delayed object creation assignment to dynamically create them
>> when needed. If you need to change the format string, it still uses the
>> formatter RHS key that all the looks use.
>>
>> Ramsey
>>
>>>
>>> Paul
>>> On Jul 27, 2012, at 7:47 PM, Ramsey Gurley wrote:
>>>
>>>>
>>>> On Jul 27, 2012, at 4:23 PM, Paul Hoadley wrote:
>>>>
>>>>> Hi Paul,
>>>>>
>>>>> On 28/07/2012, at 6:25 AM, Paul Yu wrote:
>>>>>
>>>>>> What are the rules for editing/picking a property of Joda.LocalDate?
>>>>>
>>>>> If Ramsey's component is suitable for you, that's great, but when I
>>>>> checked it out a couple of months ago, R2D2W was dependent on Wonder's
>>>>> integration branch. (Is it still, Ramsey?)
>>>>
>>>> Who has time to wait for master? :-) I commit fixes to integration. By the
>>>> time those get merged to master, I've already got other fixes committed to
>>>> integration. The only way master is going to catch up to me is if I stop
>>>> working on ponder for a month or two. That's a different discussion
>>>> though.
>>>>
>>>>> If that's a bit too bleeding edge for your purposes, it's fairly
>>>>> straightforward to put together a rudimentary property-level component to
>>>>> allow for manual LocalDate entry into a text field.
>>>>
>>>> The date components and relevant rules can be copy pasted into another
>>>> project and they'll work. I've done that on a project recently :-)
>>>> However, if you're using any other look, you'll need to remove the
>>>> accessibility features from the original html (proper form labels) or
>>>> you'll get double labeling. R2 is decidedly different in this respect.
>>>>
>>>>> Let me know if you want me to post some code.
>>>>
>>>> The more the merrier :-)
>>>>
>>>> Ramsey
>>>>
>>>
>>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]