• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Relationships howto
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relationships howto


  • Subject: Re: Relationships howto
  • From: Ken Anderson <email@hidden>
  • Date: Fri, 03 Feb 2006 06:37:55 -0500

Jim,

Are you inspecting ctryID to see if it's set? If you are, that implies to me that cntryID is a class property, and it should not be. What *should* be set is the country relationship. The cntryID will not be set until EOF is preparing to save your data to the database. You can tell if something is a class property or not be whether or not the diamond is next to it in EOModeler. The country relationship should have a diamond, the cntryID attribute should not.

Ken

On Feb 2, 2006, at 11:11 PM, Art Isbell wrote:

On Feb 2, 2006, at 4:36 PM, Jim Wong wrote:

too used to the normal DB lingo...yah...got to call them entities, attributes and objects.

as i have mentioned, I have the 2 entities COMPANY and COUNTRY already. I want a WOPopup in a web component (called newCompany) to display all the ctryNames of COUNTRY. And when user selected the country name, and click submit, the corresponding ctryID (from COUNTRY) should be placed in the ctryID attribute of COMPANY.

There you go again using that old relational DB lingo :-) You want to set company's country relationship to the country with the selected country name.


I tried creating a To-One relationship between COUNTRY and COMPANY and do the binding but seems not to work. so how do I do such binding and relationship?

Assuming that you have a to-one Company.country relationship with an optional to-many Country.companies relationship, possibly the easiest approach to describe here would be to use a WOToOneRelationship reusable component in the JavaWOExtensions framework (<http://developer.apple.com/documentation/WebObjects/ Reference/WOJExtensions/WOToOneRelationship/ chapter_33_section_1.html>). WOToOneRelationship does the right thing with inverse relationships by invoking addObjectToBothSidesOfRelationshipWithKey() unlike merely binding a relationship key (e.g., company.country) to a WOPopUpButton's "selection" key. You can certainly make a WOPopUpButton do the right thing, but a few lines of coding is required.


Aloha,
Art

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40anderhome.com


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: 
 >Relationships howto (From: Jim Wong <email@hidden>)
 >Re: Relationships howto (From: "Jerry W. Walker" <email@hidden>)
 >Re: Relationships howto (From: Jim Wong <email@hidden>)
 >Re: Relationships howto (From: Art Isbell <email@hidden>)

  • Prev by Date: Re: Relationships howto
  • Next by Date: Re: D2WQuery Component Frustration
  • Previous by thread: Re: Relationships howto
  • Next by thread: Re: Relationships howto
  • Index(es):
    • Date
    • Thread