Re: Relationships
Re: Relationships
- Subject: Re: Relationships
- From: Guido Neitzer <email@hidden>
- Date: Wed, 1 Oct 2008 21:26:03 -0600
On 1-Oct-08, at 8:19 PM, Awbrey Hughlett wrote:
I have a component with an editing context linked to an entity named
Listing. I have a WOPopUpButton that is populated from a entity
named Basic. The Basic entity has two attributes: basicID (primary
key), and basicType. basicID has a 'to many' relationship to the
basicID attribute of the entity Listing. When I save the changes to
the editing context, I want the basicID attribute in the selected
value from the WOPopUpButton to populate the basicID attribute of
the Listing entity. I can make it work if I make the basicID of both
entities a class property, but I know there has to be a better way
using the relationship I set up (given that I even did that
correctly). Does the method 'addObjectToBothSidesOfRelationship()'
have anything to do with that or am I just way off?
It does what you think it does. This method should be used to connect
two objects with a relationship. You have to have both objects in the
same editing context for this to work.
The next exercise is using the "selection" binding of the popup button
to bind to the Listing's "basic".
Check this:
<http://developer.apple.com/documentation/WebObjects/Reference/DynamicElements/WOPopUpButton/chapter_25_section_3.html
>
cug
--
Real World WebObjects Bootcamp at the Big Nerd Ranch:
http://www.bignerdranch.com/classes/real-world_webobjects.shtml
_______________________________________________
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: | |
| >Relationships (From: Awbrey Hughlett <email@hidden>) |