Re: WOPopUpButton
Re: WOPopUpButton
- Subject: Re: WOPopUpButton
- From: "SigurĂ°ur E. Vilhelmsson" <email@hidden>
- Date: Mon, 25 Jun 2007 18:30:59 +0000
Did you ever get an answer to any of your original question? Not the
question involving typography?
Yes, I'm using the code example from David (way up in the thread) with
the corrections suggested later on. I have also digested Jerry's
lesson on sessions. Now I am fighting a
java.lang.NullPointerException which I think boils down to me needing
to read a little more on instance variables and such.
Why is it that Course and CourseDescription are separate entities.
Would it not be that a Course is an entity and that entity has
attributes, such as "description"?
Does the course description change every time the course is offered?
Even though it is the same course? This seems odd.
Well, my Course entity is actually the CourseOffered you describe
below. My CourseDescription is your Course entity.
(Just FYI, some of the WO tools complain about actually using
"description" as an attribute. This is a holdover from the old ObjC
days, where 'description' was a method that everyone inherited (if I
recall correctly) from NSObject. So, you might want to come up with
another name, like "desc".)
OK, thanks for the tip. Would that also cause problems while using WOLips?
Usually, when this has been done before, people have a schema like:
Course:
name
desc
numCredits
>> CoursesOffered
CourseOffered:
startDate
endDate
location
>> Professor(s)
>> Students
> Course
Professor:
name
contactInfo
>> CourseOffered
Student:
name
>> CourseOffered
etc...
For extra credit, the Professor and the Student can actually come
from the same table, a People table. Then "Professor" and "Student"
entities can be defined via single-table entity inheritance.
The significant thing to realize about the WOPopupButton is that you
are selecting an object from a list of objects. The "displayName"
binding can decide how the object gets displayed, but only that. The
name of something is not usually a stand-alone thing. It is usually
an attribute of the object.
So, you build an array of the objects from which one should choose,
bound to "list". Then have an ivar for the list to iterate with,
bound to item. Then you have an ivar for the object that gets selected.
Google searches on WOPopupButton may show you examples. I always get
confused about whether to use "selected" or "selectedObject" for the
chosen thing. I just look it up and see that for a session-based app,
one should use "selection". Direct actions are for later.
Thanks for you help!
Best regards,
Siggi
_______________________________________________
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