Scott,

Other people have given you references to how to hook up your sub- component, so I'm not going to go into that here.

On Apr 26, 2006, at 4:58 PM, Scott Winn wrote:

First off, welcome to WebObjects!\

Thanks! Like I told Chuck. I feel like I am learning WebObjects from the inside out.

Hi WOList,

I am relatively new to WebObjects (and Java for that matter).

I am trying to create a reusable component that is essentially a WOPopUpButton with a custom fetch that generates the list attribute. That part is working. When I put this component in a page, it will be used to edit a relationship attribute of the Object the page is displaying. I am not using WOToOneRelationship because of the custom fetch logic.

I guess my first question is, why are you coupling a UI element with your model? I would really like to hear more about the custom fetch logic, and why it makes sense to have the rolled up into a component.

Apparently Project Wonder has an ERXToOneRelationship with EODataSource and Qualifier bindings, so it can't be that unusual. Unfortunately, now is not a good time to see if I can get Wonder working. For my part, I am pulling a subset of objects that have a relationship to a particular user. User X sees objects 1, 2, and 3 in the pop-up : User Y sees objects 4, 5, and 6. 1, 2, 3, and 4, 5, 6 are all the same type of thing (so they are in the same table). There is just different visibility depending on who the User is.'

Just because Wonder does something doesn't mean it's right :) Also, their solution is a little more generic than yours. Instead of gluing the reuse of your special collection of objects to the UI, why not glue it to a user, so it stays in the model?

How about a method on user that returns the possible set of objects he/she can select? The user instance could cache that array, so that anyplace you need a pop-up, you can just get it from the user. If the set of objects change, you could always hook up to EC notifications to update your list.

So in my example, instead of having 'list' bound to 'teachers', you could have 'list' bound to 'student.potentialTeachers'. Now you can use any UI element you want to display the possibilities instead of having to be stuck with WOPopUpButton.

Ken


Thanks,

Scott

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Reply via email to