(Quick Reference)

f:display

Description

f:display renders a property for display. If there is no _displayWrapper template in scope the tag will simply render the property value.

f:display template will look for a _displayWrapper for the wrapper itself and a _displayWidget for the widget used inside the wrapper template.

If the f:display tag has a body its output is used as the value passed as the value model to the _display template. If there is no body then the 'raw' property value is passed to g:fieldValue , g:formatDate or g:formatBoolean depending on its type and the result is passed as the value model to the _display template.

In version 1.5 new attributes were added: Since then you can specify the folders where the templates are located. You can do this for the wrapper folder, the widget folder ot both (if they are located on the same folder).

Examples

<f:display bean="person" property="name"/>

// renders _fields/bootstrap3/_displayWrapper.gsp: <f:display bean="person" property="name" wrapper="bootstrap3"/>

// renders _fields/maskedInput/_displayWidget.gsp: <f:display bean="person" property="name" widget="maskedInput"/>

// renders _fields/maskedInput/_displayWrapper.gsp and _fields/maskedInput/_displayWidget.gsp: <f:display bean="person" property="name" templates="maskedInput"/>

<f:display bean="person" property="dateOfBirth"> <g:formatDate format="dd MMM yyyy" date="${value}"/> </f:display>

Attributes

f:display accepts exactly the same attributes as the f:field tag.