Skip to main content

Design form template views and layout

You can control how a form template is displayed on screen and in print by configuring the views section of the moform file.

D
Written by David Bayley-Hamilton
Updated over 2 weeks ago

Each form template includes view definitions that determine how questions are arranged and presented. The screen view controls what workers see when completing the form in Mosaic. The print view controls the layout when the form is exported as a PDF. Both views reference the same underlying questions but can present them differently.


View types

Each template can have multiple views, each serving a different purpose:

View type

Description

SCREEN

Standard interactive form displayed to workers.

SCREEN_NEXT_ACT

Screen view that also includes workflow next action controls.

PRINT

Layout used for PDF or print output.

DESIGN

Preview layout used during template design.

OFFLINE_SCREEN

Screen view for mobile or offline use.


Screen view layout elements

The screen view is built using the following layout elements:

Element

Description

Section

A top-level page or section divider, with a title. Forms with multiple sections show section navigation.

Subsection

A sub-heading within a section.

Input

Renders a single question field. The questionUserCode links it to the question definition.

RepeatingTable

A table with one row per entry in a question collection. Uses TableHeader and TableColumn for layout.

RepeatingSection

A vertically stacked repeating group for a question collection.

FindPersonSubject

A search control to find and select the form's subject person.

FindParty

A search control to find and select a single person or organisation.

FindPartyTable

A multi-party search where results are stored as rows in a question collection.

NextAction

A placeholder for the workflow next action controls.

Group

A logical grouping of fields that can be cleared together.

Text

A static text block for instructions or guidance.

PairedFieldset

A side-by-side layout for two related fields.

Help

A collapsible help panel with instructional content.


Input appearance options

The appearance attribute on an Input element controls how the field is rendered:

Appearance

Rendered as

textfield

Standard single-line text input.

shorttextfield

Narrow single-line text input.

longtextfield

Wide single-line text input.

textarea

Multi-line text area.

shorttextfield

Narrow single-line text input.

longtextfield

Wide single-line text input.

textarea

Multi-line text area.

richtext

Rich text editor with formatting options.

date

Date picker.

number

Numeric input.

checkbox

Single checkbox.

radiobutton

Radio button group (for lookup fields).

dropdown

Dropdown select list (for lookup fields).

πŸ“ŒNote: The appearance must be compatible with the question's data type. For example, use dropdown or radiobutton only with LOOKUP type questions.


Print view layout elements

The print view uses many of the same elements as the screen view, with additional elements for print-specific formatting:

Element

Description

PrintProperties

Paper size, margins, and default page orientation.

PrintStyles

Typography settings for titles, section headers, table headers, and answer text.

PageHeader / PageFooter

Running headers and footers with positioned items such as page numbers.

FrontPage

An optional cover page.

Header

A content block above the first section.

InlineBlockContainer / InlineBlock

Side-by-side layout blocks, for example a title next to a logo.

Logo

An image element for use within inline blocks.

Fieldset

The print equivalent of PairedFieldset.


Template classes

Each template is assigned a class that determines what happens when the form is completed. Most forms simply save data, but some classes trigger specific business actions:

Class code

Description

Batchable

ADD_TEMP_REG

Add temporary registration

No

AMEND_TEMP_REG

Amend temporary registration

No

END_TEMP_REG

End temporary registration

No

ADD_REG

Add registration (Scotland)

No

AMEND_REG

Amend registration (Scotland)

No

END_REG

End registration (Scotland

No

ADD_CPP

Make subject of child protection plan

No

CPP_FORM

Child protection plan form

No

AMEND_CPP

Amend or end child protection plan

No

FIN_ASSESS

Financial assessment

Yes

πŸ“Œ Note: The **batchable** flag indicates whether the form can be submitted in a batch process rather than individually. Currently only the Financial Assessment class supports batch submission.


Load a form template into the database

Form templates are loaded into the database using the setup_create_form_question stored procedure. This procedure is called once per question and inserts the question definition, its version record, and its link to the template version.
​
The loading process:

  1. The stored procedure is created (or replaced) in the database.

  2. An audit session is opened.

  3. Validation rules are seeded (if not already present).

  4. View types and template classes are seeded (if not already present).

  5. The procedure is called once for each question in the template.

  6. The audit session is closed.

⚠️ Important: The loading scripts are available in both Oracle and SQL Server versions. Use the version that matches your database. Oracle uses `RETURNING ... INTO` for ID capture, while SQL Server uses `SCOPE_IDENTITY()`.


Face-to-face pre-population

Questions can be configured to participate in face-to-face pre-population, where data from a previous face-to-face interaction is carried forward into a new form.
​
By default, questions are set to NO_F2F_PREPOP (not eligible for face-to-face pre-population). To enable it, set the form_selection_criterion when loading the question.
​

Did this answer your question?