Re: D2W: How to turn on relationship editing?
Re: D2W: How to turn on relationship editing?
- Subject: Re: D2W: How to turn on relationship editing?
- From: David LeBer <email@hidden>
- Date: Mon, 7 Sep 2009 20:51:47 -0400
On 2009-09-07, at 8:29 PM, Ramsey Lee Gurley wrote:
On Sep 7, 2009, at 6:49 PM, Mr. G Brown wrote:
Hello,
On Sep 7, 2009, at 11:32 AM, David LeBer wrote:
Are they being displayed but are not editable in an edit form?
They are displayed, if there is a linked record in the linked-to-
table, it lists the attributes, but not a way that enables to re-
link it to a different record.
If there is no linked-to record, there are no attributes to display.
The old D2W from Apple had a relationship edit page, a way to re-
link to a different record.
It sounds like you just need to switch out the component being used.
Are you still using the default MenuHeader for the application? If
you are, you should be able to see some debugging helpers on it...
probably over on the bottom left of the window.... Log4J, D2W,
CSS, ... etc. When you click the 'D2W' link and enable the D2W
debugging info, you should see question marks after each property
label in the interface. Hovering over the question marks displays a
table of useful information for the property level component. One
of those bits of useful information will be componentName. Can you
see what the componentName is for the property? If you aren't
reading ERD2WEditToManyFault or ERD2WEditToManyRelationship...
that's probably your problem. It sounds like you are getting a
ERD2WDisplay... component instead, since it offers you no way to
change the values.
I find it helpful to create a model group for my projects in
RuleModeler (File -> New Model Group) that I add references to all of
the model files that my project depends on. Something like:
MyApp: user.d2wmodel
MyFramework: d2w.d2wmodel
MyLook: d2w.d2wmodel
ERDirectToWeb: d2w.d2wmodel
JavaDirectToWeb: d2w.d2wmodel
This makes it easier to trace all of the rules that may apply.
For your particular problem, try adding rules like the following:
90 (task = 'edit' and smartRelationship != null and not
(smartRelationship.isToMany = 1)) => componentName =
"ERD2WEditToOneRelationship" [Assignment]
90 (task = 'edit' and smartRelationship.isToMany = 1) => componentName
= "ERD2WEditToManyFault" [Assignment]
If I remember correctly the default Wonder rules seem to miss these.
Are you using vanilla WO or Project Wonder?
Project Wonder.
Good decision. In general of course, but especially for D2W.
Yes, don't Direct to Web without it.
Do you have the relationships specified in your
displayPropertyKeys or sectionContents?
No, I have the default displayPropertyKeys, is that my problem?
If you're seeing the property in the interface, no. :-)
what is a "sectionContents"
It's a wonder thing. It's like displayPropertyKeys, but it allows
you to have a tabbed edit interface so you can break the edit page
into smaller chunks.
Or style your forms nicer:
<http://davidleber.net/?p=272>
;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
twitter: http://twitter.com/rebeld
--
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