Next: Validation
Up: Abstracting data views
Previous: Adding a view
  Contents
A composite field may be added to a view in two ways.
- A single field is needed i.e. a user has a company
that is of type Company - but in a blotter view the only field needed is the
companyName. Thus, in the view we specify the
foreign-field attribute:
<field name="company" type="${user.pkg}.Company">
<view in="quick" foreign-field="companyName"/>
</field>
...
note: that companyName needs to be a valid field in the
Company object.
- More than one field is needed - so a view of the composite field
is required. The foreign-view attribute is used instead and
a view that exists in the other class must be specified.
<field name="company" type="${user.pkg}.Company">
<view in="quick" foreign-view="simple"/>
</field>
...
2002-03-05