• 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: WOPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOPopUpButton


  • Subject: Re: WOPopUpButton
  • From: David LeBer <email@hidden>
  • Date: Thu, 21 Jun 2007 16:43:41 -0400


On 21-Jun-07, at 2:15 PM, Sigurður E. Vilhelmsson wrote:

I figure I need to build an NSArray and populate it with the values
from the Course_description table and then use that to populate the
course_descriptionID in the Course table, but exactly how to do that
is just out of my reach.

First thing, your naming convention looks a little wonky. Java usually uses CamelCase for class and method names.


So:

Your Java would look something like this:

	public Course course; //assume exists
	public CourseDescription courseDescriptionItem;

	//
	//

	public NSArray allCourseDescription s() {
		EOEditingContext ec = ((Session)session()).defaultEditingContext();
		return EOUtilities.objectsForEntityNamed(ec, "CourseDescription");
	}

	// the magic of getting a wopopup to work lie in these two methods

	public CourseDescription selectedCourseDescription() {
		return course.courseDescription();
	}

public void setSelectedCourseDescription(CourseDescription aDescription) {
course.addObjectToBothSidesOfRelationshipWithKey(aDescription "courseDescription");
}


Your .wod would look something like this:

CourseDescPopup: WOPopupButton {
	list = allCourseDescription;
	item = courseDescriptionItem;
	displayString = courseDescription Item.name;
	selection = selectedCourseDescription;
}



--
;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org


_______________________________________________ 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: WOPopUpButton
      • From: Ian Joyner <email@hidden>
References: 
 >WOPopUpButton (From: "Sigurður E. Vilhelmsson" <email@hidden>)

  • Prev by Date: Re: Java Client refuses to use Client-Side classes once deployed
  • Next by Date: Re: Java Client refuses to use Client-Side classes once deployed
  • Previous by thread: WOPopUpButton
  • Next by thread: Re: WOPopUpButton
  • Index(es):
    • Date
    • Thread