Edition Detail Example
This example makes liberal use of s:isVisible and s:isEditable settings to control the editability of the form's input fields (depending on whether a given Edition is currently 'saved'), as well as the accessibility of various controls. It also demonstrates a generic way to manage radio buttons, and a couple of different ways to manage select lists.
Notes On This Example
The form bean backing this example's view keeps track of which editions are 'saved,' and exposes a method to determine the status of the edition on the on the current page. A TBODY element in the form binds that method to an s:isEditable attribute.
Note that when Input elements are not editable, they render themselves
as static text. Because editability cascades, the TBODY's
attribute should govern the editability of any and all nested input
elements (unless overridden locally). That's why, absent any validation errors,
Save 'turns off' the whole form; and why subsequently clicking
Cancel (which toggles the
saved status back to
'turns it on' again.
Other Features Shown in this Example
- Cross-field validation. An s:crossFieldOR custom attribute on the form element registers a CrossFieldValidationRule for the price and coverPrice fields
discountType SELECT element uses a
DynamicTypeCodeto supply its options list and track the selected value. Settings shown include:
- defaultValue Sets the string to be displayed when there is no selection.
- labelFormat Defines how the label is displayed.
Allows settings to be passed to the
Formatter; in this case a setting is supplied to define the order in which to sort the options list.