• 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
newbie q: multiple fields insertion?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie q: multiple fields insertion?


  • Subject: newbie q: multiple fields insertion?
  • From: Jeremy Matthews <email@hidden>
  • Date: Thu, 24 Nov 2005 11:37:15 -0500

Following this example is easy:

public WOComponent createBlogEntryAction()
    {
EOEditingContext ec = session().defaultEditingContext();
EOEnterpriseObject newEntry = EOUtilities.createAndInsertInstance(ec, "BlogEntry");
newEntry.takeValueForKey(title, "title");
        newEntry.takeValueForKey(body, "body");
newTitle = newBody = null;
ec.saveChanges();
return null;

    }

However, I don't want to create a dozen single keys in WOBuilder, and I'd rather create a key that references the Entity, so I can easily drag its attributes to the correct fields. So, I created a new key "newEntry" and made it of type "BlogEntry" (which is the entity that includes title and body), instead of a bunch of independent strings. This creation showed a key with references to all the attributes in that entity.

However, I'm a bit confused as to how to replace these lines:
newEntry.takeValueForKey(title, "title");
newEntry.takeValueForKey(body, "body");

Since it no longer works, as those references now point to:
newEntry.title
newEntry.body

I've tried replacing title for newEntry.title (and the body attribute as well), but it doesn't work. 
What does?


Thanks,
jeremy

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: newbie q: multiple fields insertion?
      • From: David LeBer <email@hidden>
  • Prev by Date: WebServices and Clients. Win and Mac - work in the pair
  • Next by Date: WODisplayGroup advice needed
  • Previous by thread: WebServices and Clients. Win and Mac - work in the pair
  • Next by thread: Re: newbie q: multiple fields insertion?
  • Index(es):
    • Date
    • Thread