Re: Using a text formatter on a WOBuilder WOString object
Re: Using a text formatter on a WOBuilder WOString object
- Subject: Re: Using a text formatter on a WOBuilder WOString object
- From: Nat Fast <email@hidden>
- Date: Tue, 17 Jun 2003 19:01:10 -0700
This did the trick!
Thank you very much. This is obviously a legacy of the whole one-to-one
relation issue that has been documented on this board extensively,
where if you edit and recall a WOComponent the database loses synch
with the session and you lose your data. That was the first problem I
had and had to solve it with the one-to-many, single item object. I
misplaced the accessor code I did not place it in the Database class,
but rather in the edit form where I first encountered the problem. By
modifying the Database class file all problems went away.
Thank you again.
Nat
On Tuesday, June 17, 2003, at 06:36 PM, Chuck Hill wrote:
Do you mean that your toMany is guaranteed to return only 0 or one
objects?
If so, why not make a cover method to return that one object?
public Berth berth()
{
return berths().count() > 0 ? berths().lastObject() : null;
}
That should avoid the whole keypath result wierdness and is more
"correct"
than a formatter to strip off ("...").
Chuck
At 06:25 PM 17/06/2003 -0700, Nat Fast wrote:
Unless I have misunderstood, the problem is that a to-many
relationship is
being inlcuded in a keypath whenn a single object resultis wanted.
Calling
valueForKey on an NSArray yields an NSArray.
Chuck is correct. The repetition is iterating over rootRec. The to
many
relationship is in the middle of an extensive keypath that leads to a
string object.
It returns the correct value, just in the wrong format for display.
While it may be "proper" to reform the database to alleviate this
issue, it would remove the normalcy of data I have been pushing
towards
in that I would have to duplicate the values in the higher order
object
A. EO Modler will not allow me to create a one-to-one for the class in
that the primary key is different.
So unless there is some great wisdom out there, I guess I am in Kludge
land. So how do those formatters work?
Nat
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Chuck Hill email@hidden
Global Village Consulting Inc.
http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.