Hi,

I want to use a ERD2WEditToOneRelationship in a D2W page with a statically
defined list of options using an enum for the list. I've followed the
presentation in the screencast "D2W Custom Assignments and Component Design
(WOWODC 2010)".

I've set up this rules:

100 : (propertyKey = 'person.gender' and entity.name = 'Party' and task =
'edit') => componentName = "ERD2WEditToOneRelationship"
[com.webobjects.directtoweb.Assignment]
100 : (propertyKey = 'person.gender' and entity.name = 'Party' and task =
'edit') => keyWhenRelationship = "name"
[com.webobjects.directtoweb.Assignment]
100 : (propertyKey = 'person.gender' and entity.name = 'Party' and task =
'edit') => restrictedChoiceKey = "object.person.genders"
[com.webobjects.directtoweb.Assignment]

But when the entity is updated the following exception is thrown:

IllegalArgumentException: While trying to invoke the set method "public
void models._Person.setGender(java.lang.Integer)" on an object of type
models.Person we received an argument of type enums.Genders. This often
happens if you forget to use a formatter.

  at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.throwMethodExceptionWithDescription(
NSKeyValueCoding.java:1128)

And in my entity Person I have

public NSArray<enums.Gender> genders() {

return new NSArray<enums.Gender>(enums.Gender.values());

}

ERD2WEditToOneRelationship correctly uses the Gender name, so I expected it
to use the value in the Gender enum, but it doesn't seem to do so when
assigning the entity attribute gender.

A little help with this will be very valuable, since it seems so simple to
work with enums and ERD2WEditToOneRelationship to represent static lists of
values.

Thanx,

Angelo
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to