<nerderg:formfield label='Select one' field='age' bean='${myCommand}'> <g:select name="age" from="${18..65}" value="${myCommand.age}"/>
</nerderg:formfield>

The above tag will produce something like this (depending on CSS):


See source

Tag specific attributes

  • hideValue (since v1.3) - by default the value of a bean supplied to the formfield tag is displayed as text in the value portion of the formfield before the body. To hide the value (not display it) add the hideValue="${true}" attribute

Notes

  • The formfield tag gives you control over the body content and the input. It provides error highlighting if a bean and field are supplied. This can be used just to display information with a label too.
  • The CSS will format it as table cells so that you end up with aligned labels and values. (if you set the table property then it will be a table row).

Copyright © nerdErg Pty Ltd 2012 ABN 20 159 294 989