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:

Get hands-on with 1200+ tech skills courses.