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.

Available Out of Print

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 s:isEditable attribute should govern the editability of any and all nested input elements (unless overridden locally). That's why, absent any validation errors, clicking Save 'turns off' the whole form; and why subsequently clicking Cancel (which toggles the saved status back to false), '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
  • DynamicTypeCode. The discountType SELECT element uses a DynamicTypeCode to 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.
    • formatterSettings 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.