robfletcher/grails-fields — Issue #47: Use SiteMesh to wrap inputs with surrounding structure
Author: robfletcher
Created: 2012-02-13 17:33:29+00:00
State: open

This would fundamentally change how the plugin currently works.

* Instead of a `_field.gsp` and `_input.gsp` template there would be a single template in the current location and a SiteMesh layout under `grails-app/views/layouts/_fields`.
* The `f:field` and `f:input` tags would be merged so that they lookup up the template for rendering the input (or used default as currently) then surrounded that with the layout, looked up in a similar way.

## Advantages:

1. There would only be an `f:field` tag which makes rendering a bit more direct.
2. It's a clearer structure, the SiteMesh template is a layout for the input.

## Potential issues:

1. Breaks existing usage.
* `_field.gsp` tags would need to get moved under `grails-app/views/layouts/_fields`.
* current `<%=widget%>` code would need to be replaced with ``.
* might require renaming of existing `_input.gsp` templates depending on implementation.
2. Not sure of performance implications of using SiteMesh.
3. Would need to be careful with any lazy initializers that might get triggered in the layout.

Please contribute any thoughts…