We didn't initialize the celebrity property, so its value is null, and still
everything works fine since BeanEditForm can create an instance of the
edited property as required. One consequence of this is that the type of
property should be a concrete class, not an interface.
BeanEditForm took all the properties of the edited class and created a field in
the form for each of them.
For each property that it can edit, BeanEditForm automatically selects a
certain control. For a string or a numeric property it displays a text box, for
an enumeration??”a drop-down list, for a boolean property??”a checkbox, for a
date??”a DateField component (which will be described soon). However, we
can easily override the default choice if needed.
BeanEditForm generates a label for each property based on the property
name in the same way as the Grid component did. And in the same way
we can override the default label by providing an alternative for it in the
application's message catalog, with a key like the propertyName label.
If the object edited by BeanEditForm, as provided by the page class, contains
some values in it, those values will be displayed in appropriate fields of the
form. As soon as you click on the Create/Update button, the values in the
form fields will be put into the appropriate properties of the edited object.
Pages:
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191