Support > Repository > Business logic > Model basics (2)
ja | en

Describe the presentation model, condition model, list model.

The model reference item in the store model holds only the primary key of the referenced model.The presentation model includes "content part" in this.

They are called "ID part" and "content part", respectively, to distinguish them.

In the presentation model,It contains all the information displayed on the screen. The presentation model has "display mode" and "update mode".Both models are handled differently.

The display mode has a content part corresponding to the ID of the reference model owned by the store model.This is a 1: 1 relationship.

The update mode includes all other choices that were not selected.On the registration/update screen, items (candidates) other than those currently selected are also displayed on the screen.These choices are included.

Figure 1 Image of Presentation Model (expressed in XML format)

Generation timing

Registration screen - Screen display

The first store model with the initial value set is generated.Primary key is undetermined.It converts this to the presentation model (update mode) and uses it in the Web form.

Registration screen - Register

A presentation model is generated based on values ​​entered from the Web form.Convert this presentation model to a store model and store it in the database.

Update screen - Screen display

It converts the store model read from the database into the presentation model (update mode) and uses it in the Web form.

Update screen - Update

A presentation model is generated based on values ​​entered from the Web form.Convert this presentation model to a store model and store it in the database.

Detail screen

Convert the store model read from the database to the presentation model (display mode).This is output to the screen.

About type

All values ​​that the presentation model has are 'string type'.When converting with the store model, it is converted to an appropriate type.

Presentation model specific information

For each model item, holds information on input errors.In the case of choices (list boxes, radio buttons, check boxes), information on whether or not they are in the selected state is retained.

Handling of input errors

When an input error occurs on the registration/update screen, the presentation model with the embedded error message is recreated and resent to the input screen.

The condition model is almost the same shape as the store model, but it is not stored in the database.

In range search of numerical type and date type, two input fields are managed.Within the Java class, fields "item name +" jshparam1 "" item name + "jshparam2" "are prepared.

The condition model is stored in "(HTTP) session".For this reason, the state of the condition model is memorized for each search screen.

From the search results (collection of store models), the items to be output to the list display screen are selected and stored in the container called "Item".

On the display side, list display is realized by processing items stored in the list model in a loop.

Figure 2 List model image (expressed in XML format)