-
Notifications
You must be signed in to change notification settings - Fork 5
Form Engine
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.
Hybrid, it can be a boolean or String. Valid String values are '' or 'pdf'
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.
boolean
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.
String
This is the actual JSON definition for the form
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