Form Engine - AtlasOfLivingAustralia/ecodata-client-plugin GitHub Wiki

The ecodata-client-plugin uses various tag libraries to configure and start the form engine that enables the use of JSON form definitions.

  • Model Tag Library - md
  • Model Javascript Tag Library - md
  • Model CSS Tag library - md

Note: TODO document tag libraries calls that are used to initialise Form engine


There are Some attributes passed to the different tag libraries that change the behaviour of them.

Attributes

printable

Data type

Hybrid, it can be a boolean or String. Valid String values are '' or 'pdf'

Purpose

Signals that a form and all of contained view types will be displayed in a format suitable for printing. If printable value is 'pdf' content will be displayed as in read-only mode with the exception that autocomplete types will be displayed as text with no help icon/

If printable value is true the form will be displayed in a format suitable for printing. Url will be displayed alongside the link text for example.

If printable is false it the form will be displayed either in view or edit mode according to edit attribute or noEdit parameter.

This attribute takes precedence over edit.

edit

Data type

boolean

Purpose

Display a form in either edit mode if the value for this attribute is true using text fields for text typer for example, input controls ase enabled or read only if attribute is false, text values are displayed as labels, select boxes are not editable.

This attribute has no effect if printable is not false.

model

Data type

String

Purpose

This is the actual JSON definition for the form

Example

The example below initialises the view model for a GSP page.

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <md:modelStyles model="${model}" edit="true"/>
</head>
<body>
<div class="container-fluid validationEngineContainer">
        <div class="span10 example">
            <h3>${model.title ?: model.modelName}</h3>
            <md:modelView model="${model}" edit="true" printable="${false}"/>
        </div>
</body>
</html>

A complete GSP with the whole form engine initialisation can be found here

The live page with example pages can be accessed here

⚠️ **GitHub.com Fallback** ⚠️