Monday, 9 September 2013

Increasing the size of a f:field (input) with Grails Fields Plugin (but without loosing DRY)

Increasing the size of a f:field (input) with Grails Fields Plugin (but
without loosing DRY)

I want to change this:

By this:

Twitter Bootstrap make it easy. We just have to add:
class="input-xxlarge". But if we just add this to a f:field, it doesn't
work:
<f:field bean="bestInstance" property="honor" class="input-xxlarge"/>
The solution so far is to copy the source code generated with the f:field
and add it. This is the result code (after adding class="input-xxlarge):
<f:field bean="bestInstance" property="honor">
<input class="input-xxlarge" type="text" name="direccion" value=""
required="" maxlength="100" id="direccion" />
</f:field>
It works, but it is not DRY anymore. Is there any way to do it without
loosing the DRY capacity of Grails Fields Plugin?

No comments:

Post a Comment