To view the sample for this task, import the advanced sample projects as described in Import the Forms Advanced Samples. The sample forms and business object model for the task described in this section are contained in the
forms.samples.bom sample project.
The form for this task (CapturePreferences.form) is at the following location:
The business object model (FormsSamplesBOM.bom) is at the following location:
The business object model in the forms.sample.bom project models a
Person class, a
Preferences class, and three enumerations,
Gender,
Colour, and
Beverage. There is a unidirectional composition association
Person::preferences : Preferences[0..1]. (There are also some other types in the business object model that are not used in the present task, but pertain to other advanced task examples that also use this business object model.)
The CapturePreferences form shows a
Person, his or her personal details, and preferences.
The Gender radiogroup choices are defined by the
Person::gender : Gender[1] BOM feature, and the control is flagged as
required to reflect the non-optional multiplicity of the feature. In the
Properties tab of the
Properties view, you can see the external reference to the
Gender enumeration and the choice labels and values implied by that enumeration's literals. Note how the enumeration literals' labels and values in the business object model are automatically reused in the form.
The Favourite Colour optionlist is bound to the corresponding
Preferences::favouriteColour : Colour[1] feature. As above, the feature is mandatory and the control is flagged as
required. The choices are defined by the literals of the
Colour enumeration.
The Favourite Drink optionlist is bound to the corresponding
Preferences::favouriteDrink : Beverage[0..1] feature. Again, choice labels and values come from the BOM. This time, however, the feature is optional and the control is not flagged as required. Note that the
Properties tab shows an additional choice (
unset); this is only generated for a control that is
not required.