On Jan 20, 2010, at 6:40 AM, Riccardo De Menna wrote:

> Hi all,
> 
> A D2W related question...
> 
> I want a component that allows me to edit a record and also edit another one 
> through a relationship. An InlineEditRelationship thing. I want it because I 
> often have correlation tables in to-many relationships that only hold a few 
> fields and it's too confusing for the user to force them to jump and edit 
> another record all together. To the average user, fields of a correlation 
> table are often viewed as data of one or the other side of the relationship.
> 
> Let's say we have a Movie << Correlation >> Actor scenario. And we need to 
> keep track of what was the name of the character the actor played in a movie 
> (or his salary or anything related only to that movie). I want to build an 
> EditMovie page that allows me to select the actors that participated to the 
> movie via a very simple and straightforward popup menu and every time I add a 
> new actor I get also a single field for the character name to appear directly 
> inline in the ui. No faults... I'm assuming the actor list is a short one.


It sounds like you need something like Movie <-->> Roles <<--> Actor rather 
than a simple many-to-many join from Movies to Actors.  Perhaps that is the 
correlation table you mentioned?


> Now my question... how should I do this? I thought about two examples.
> 
> Example one:
> 
> I build a D2W component that edits a relationship by basically sticking a 
> InspectRepetition in it (obviously in a compact short form). When I try to do 
> this I constantly fight against the fact that the D2WContext is setup to edit 
> another entity. So I thought I could build a "subcontext" by cloning the 
> current one and setting it to edit the other entity and pass this via the 
> d2wcontext binding of the repetition component. Would it work or am I going 
> to face a million problems? Forms into forms being the first I can think of.


ERXWOForm prevents nested forms for you.  But you're right, it's not going to 
work without a separate d2wcontext because you're trying to stick one page 
configuration into another.


> 
> Example two:
> 
> I generate a totally different EditPage via the D2WFactory methods and stick 
> it in my parent component via WOSwitchComponents. This also basically does 
> what I'm doing in example one since the newly created page will have it's own 
> D2WContext.
> 
> Or is there a simpler way? I tried just sticking embedded components without 
> touching the d2wContext by simply binding everything I could think of 
> (d2wContext, datasource, object, keys for the relationships... everything) 
> but I constantly run into something that get's pulled out of the d2wcontext 
> instead of the bindings and messes everything up.
> 
> I'm in a "wonder enabled" scenario so I can use anything there as well. I saw 
> Ravi does something similar in one of his tutorials but it's a single field. 
> I want a full fledged edit-in-edit thing. Will I be fighting windmills by 
> trying?
> 
> Any opinion is welcome and btw, happy start of year to everyone,
> Riccardo

Using a WOSwitchComponent is still going to leave you with the same problem as 
above.  You need to use an embed component if you want to embed one page 
configuration into another one.  A D2WEdit or perhaps an ERXD2WInspect.  If you 
ran into problems using the embed components, I would suggest you have a look 
at something like the ERNEUEditRelationshipPage.  It uses an embedded edit, 
list, and query all in one page.  It should be enough to help you figure out 
what you're missing in your bindings.

Ramsey



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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 arch...@mail-archive.com

Reply via email to