Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

That's the default component which displays the to-one relationship. If you create a new D2W application, there should be a rule in you *user.d2wmodel* :

Wiki Markup{{100 : (smartRelationship \ != null and smartRelationship.isToMany = 0 and task = 'inspect') => componentName = "ERD2WDisplayToOne" \ [com.webobjects.directtoweb.Assignment\]}}

The default behavior of this component is to show all the fields of the object separate by ", " :


You can choose which propertyKey you want to display, and enable the link to go to the inspect page of this object :unmigrated-wiki-markup

{{100 : (task = 'inspect' and propertyKey = 'customer') => keyWhenRelationship = "name" \ [com.webobjects.directtoweb.Assignment\]}} Wiki Markup{{

100 : (task = 'inspect' and propertyKey = 'customer')  => disabled = "false" \ [com.webobjects.directtoweb.Assignment\]}}

In this exemple you will have a link to the customer your object is in relationship with.

...

First, choose the propertyKey you want to set the to-one relationship, and assign the component :unmigrated-wiki-markup

{{100 : (task = 'edit' and propertyKey = 'currency') => componentName = "ERD2WEditToOneRelationship" \ [com.webobjects.directtoweb.Assignment\]}}

Don't forget to set the keyWhenRelationship rule :unmigrated-wiki-markup

{{100 : (task = 'edit' and propertyKey = 'currency') => keyWhenRelationship = "code" \ [com.webobjects.directtoweb.Assignment\]}}

You will have something like that :

...

You can work on the template to arrange it, but there's also different ways to set this component. You can set the toOneUIStyle rule like this :unmigrated-wiki-markup

{{100 : (task = 'edit' and propertyKey = 'currency') => toOneUIStyle = "popup" \ [com.webobjects.directtoweb.Assignment\]}}

And you will have this behavior :

...