-
✓ Rendered into HTML
-
❏ Rendered into Mails
-
❏ Rendered into PDF
-
❏ Rendered into CSV
Form Validation

When saving an object, errors are reported, localized, with no additional cost…
See Grails documentation on Constraints Usage to check your object validity before saving.
Code Sample
def userForm(User user) {
user ?= new User(params)
UiFormSpecifier f = new UiFormSpecifier() (1)
f.ui user, { (2)
section "User", { (3)
field user.username_ (4)
field user.firstName_
field user.lastName_
ajaxField user.manager_, (5)
this.&selectUserM2O as MC
field user.password_
}
section "Coords", {
field user.businessUnit_
field user.mail_
field user.subsidiary_
}
section "Status", {
field user.enabled_
field user.accountExpired_
field user.accountLocked_
field user.passwordExpired_
}
formAction "Save", this.&saveUser as MC, (6)
user.id, true
}
UiBlockSpecifier b = new UiBlockSpecifier() (7)
b.ui {
modal {
ajaxBlock "userForm", {
form "User Form", f, BlockSpec.Width.MAX
}
}
}
taackUiSimpleService.show(b) (8)
}
-
Create the form
-
Pass object to be edited and spec of the form
-
Section called user
-
Basic field, terminating with an underscore, those symbols are generated by Taack AST on class with the
TaackFieldEnum
annotation -
Many To One relation, the action
selectUserM2O
will open a popup to select the manager of the user -
Specify an action where the form will be sent to. Here it is
saveUser
, it will save the user -
Create the block in a modal
-
Display it …

DSL Symbols Hierarchy
DSL Elements
Inputs
-
hiddenField
: add an input of type hidden into the form. -
field
: add an input with a label. -
ajaxField
: add a many 2 many or many to one field. The MethodClosure must point to a block showing a modal window
Structure
-
section
: add a form section, optionally Width of the section -
col
: Allows splitting section into columns
Action
-
formAction
: Label, action called, params of the action (either id and map), is ajax