• 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
Using Relationships & Display Groups
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using Relationships & Display Groups


  • Subject: Using Relationships & Display Groups
  • From: David Griffith <email@hidden>
  • Date: Fri, 20 Feb 2004 13:10:13 +0100

Hi,

This is a newbie question I guess, but honestly it is so hard to find any
step-by-step useful information for the WebObjects beginner.  I have been
using RAD tools for years and am having real difficulty getting into the WO
way of doing things.

So, the first question is:

I have for example, 2 tables.  Country & Zone.

Country <<--> Zone

So Country can ask for it9s Zone and Zone can ask for the Countries in that
zone.  This makes sense in a logical way.
Country contains countryID (primary key) and countryZoneID (foreign key for
zone).
Zone contains zoneID (primary key).

What I want to know is, when using the
country.addObjectToBothSidesOfRelationshipWithKey(zone, 3zone2) - does this
effectively set the foreign key of the country to hold the primary key of
the zone?

Let me describe the scenario in a little more detail:

I have a WOComponent that uses a display group (combined with a PopUpButton
rather than a WORepetition) which displays all the existing Zones and
permits me to add new ones.  This works fine.

Then, I have another WOComponent for adding and editing countries.  Each
country must have a Zone.  So I have a display group for listing the
countries, from which I can select a country and edit it etc.

When adding a country, I obviously need to specify the zone it belongs to.
For this, in the data part of the page, I have another PopUpButton which
uses another display group to list all the zones available.  I want to enter
the country name for a new country, then select the relevant zone from the
Zones pop up.  This will submit the zoneForm and allow the selection to be
acknowledged.

So, at this stage I have a new country name entered, and I have selected a
zone from the list of zones.  I know want to relate9 them when the new
country is saved.  Basically, I am getting an error each time stating that
the countryZoneID (the foreign key for the zone in the country table) is
null and therefore cannot be saved.  I have tried
country.addObjectToBothSidesOfRelationship(selectedZone, 3zone2) but it
seems to make no difference.

I hope someone has some idea what I am talking about and can help!  If I can
get a clearer understanding of how this works it will open things up
tremendously for me!

Kind regards,
David.
_______________________________________________
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.

  • Prev by Date: Re: to-one fault: determine if will take trip to db?
  • Next by Date: Re: rollback OSXS JVM 1.4.2 to 1.4.1
  • Previous by thread: Moving Files
  • Next by thread: Horizontal mapping and to-one relationships
  • Index(es):
    • Date
    • Thread