Re: WOPopUpButton
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
References: | |
| >WOPopUpButton (From: "SigurĂ°ur E. Vilhelmsson" <email@hidden>) |