View Code

Let’s learn how the view code changes that incorporate enumerations into the application.

The enumeration application’s UI for creating a new book record will contain these four choice widgets:

  1. A single selection list for the attribute originalLanguage.
  2. A multiple selection list for the attribute otherAvailableLanguages.
  3. A radio button group for the attribute category.
  4. A checkbox group for the attribute publicationForms.

Selection lists

We use HTML selection lists to render the enumeration attributes originalLanguage and otherAvailableLanguages in the createBook.html and upateBook.html HTML forms. Since the attribute otherAvailableLanguages is multi-valued, we need a multiple-selection list, shown in the following HTML code:

  • HTML
  • Output
html
output
Multiple selection list

The output doesn’t look too good in isolation. This will be fixed when this code is combined with the rest of the code.

While we define the select container elements for these selection lists in the HTML code of createBook.html and upateBook.html, we also fill in the option child ...