The outer condition is true
Things to note about this example:
- The top part uses the If, Else, and For components outside a form.
The bottom part uses the same components in almost the same way,
but it is located within a form. Have a look at the HTML source of
the page -- the components in the bottom part have generated hidden
fields and store their data in there to guarantee that a submit of the
form will be independent from changes of the data (in the database or elsewhere).
- The hidden fields of the For component contain the "primary keys"
of the data, rather than the data itself. The keys are extracted using
the converter passed to the For component. This is optional, and in this example
it does not do much -- just prepends XXX to strings (see Home.java),
but in real situations it can be quite helpful as it
allows the storage only of a tiny identifying part of the data.
- Select a color and submit the form several times. The order of the colors
will change, but the correct color will remain selected and the application
will continue to work fine. The For component would also work okay if
the number of items in the loop changes dynamically.
- Clicking on the topmost checkbox will automatically select and then deselect
the other checkboxes. This is achieved using the components in the Checkboxes library.