• 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: newbie question - displaying emodel relationship destination attributes/
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question - displaying emodel relationship destination attributes/


  • Subject: Re: newbie question - displaying emodel relationship destination attributes/
  • From: Jonathan Rochkind <email@hidden>
  • Date: Tue, 01 Apr 2003 14:11:52 -0600

Because your relationship from author to books is a to-many relationship. This makes sense, because an author can have many books.

So authorItem.books is actually an array of Books. And authorItem.books.title is actually an array of book titles---an array of all the titles of all the books owned by that author. So when you output it, you get the String representation of such an array.

In this case, it's just got one book in it, so it looks like ("Title"). If it had more books, it would look like ("Title1", "Title2", "Title3").

What you want to do is, not output the String representation of an Array, but instead use a WORepetition to step through each book in the author's book array, and then print out the title of each book, seperated however you want. Each one in a seperate table row, seperated by HTML BR to put each on a different line, whatever.

--Jonathan

At 10:32 AM 4/1/2003 -0500, Betty Chang wrote:
Hi -- I hope you will all forgive my dumb questions for a while as I struggle
a bit.
I created an entity "author", and an entity "book", and I have a relationship
from author to book joined by an authorID attribute.   The book entity has an
attribute "title". On my web page, I can display  authorItem.books.title, but
why does it appear in quotes surrounded by parentheses?
(e.g. it shows as '("Big Book")'   instead of just  'Big Book'   in my table
cell?

Betty
_______________________________________________
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.

References: 
 >newbie question - displaying emodel relationship destination attributes/ (From: Betty Chang <email@hidden>)

  • Prev by Date: Re: Project Builder Question
  • Next by Date: Re: Project Builder Question [Solved]
  • Previous by thread: newbie question - displaying emodel relationship destination attributes/
  • Next by thread: Delegation
  • Index(es):
    • Date
    • Thread