• 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
WOPopupButton - want a value list for a foreign key
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WOPopupButton - want a value list for a foreign key


  • Subject: WOPopupButton - want a value list for a foreign key
  • From: "Thomas Peters" <email@hidden>
  • Date: Sat, 14 Dec 2002 20:54:13 -0500

I want to fill a WOPopupButton with the values from a parent object. I found
an example that uses an NSArray. However, I wonder if I should handle things a
little differently than this:

    public static NSArray getCategoryNames() {
         return (NSArray)allCategories().valueForKey("categoryName");
    }

    public static NSArray allCategories() {
        EOSharedEditingContext ec = session().defaultSharedEditingContext();
        EODatabaseDataSource ds = new EODatabaseDataSource(ec,
"ProductCategory");

        return ds.fetchObjects();
    }

This works to fill the menu with names, but my Category data has cat_id &
cat_name. The foreign key in product is cat_id. I am trying to create a
WOComponent that has a popup with the categories. I have the popup list bound
the the getCategoryNames.

Some questions:
  Is it better to use NSArray or should I create another displayGroup in the
WOComponent?
  If I create a categoryDisplayGroup, how should I setup the bindings for the
WOPopupButton?
  How can I create a multi-dimensional NSArray that stores the cat_id &
cat_name from the ProductCategory EObject?
  I need an example of how to set the bindings up for this WOPopupButton to
store the value from the popup into an attribute of the bound EObject?

Thanks for the help.
_______________________________________________
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.

  • Follow-Ups:
    • Re: WOPopupButton - want a value list for a foreign key
      • From: Art Isbell <email@hidden>
  • Prev by Date: PB2.1, encoding and System.out.println from WO5.2
  • Next by Date: Demonstrations Run Errors
  • Previous by thread: PB2.1, encoding and System.out.println from WO5.2
  • Next by thread: Re: WOPopupButton - want a value list for a foreign key
  • Index(es):
    • Date
    • Thread