grails-jttaglib plugin is a small collection of convenience tags.

The sample code below assumes you have a domain class that looks like this:
 class Book {
String title="my new book"
String content

static def constraints = {

When using these tags, you must have the following in the page - normally in the head block:
<g:javascript library="prototype"/>

<jttext:script />


Creates a TextArea HTML element, where the maximum number of characters is
limited by the constraints on the domain object, and tabs can be allowed if

Sample use:
<jttext:textArea object="${new Book()}" name="content" allowTabs="true"/>

<jttext:statusDiv for="content" />

The number of remaining characters available are displayed in the status div.
If allowTabs is set to true, tabs can be entered in the text area.


Creates a text input type using maxlength from the objects constraints.
Sample use:
<jttext:textField object="${book}" name="title"/>

<input type="text" name="title" maxlength="20" value="my new book" id="title" />


Popular posts from this blog

Using the Crystal Reports Java API to generate PDF

No Scope registered for scope request

Using Selenium WebDriver to select JSF/PrimeFaces selectOneMenu options