Question about field Tag based on an issue in yabe Guide9

7 views
Skip to first unread message

GrailsDeveloper

unread,
Aug 10, 2010, 1:54:23 PM8/10/10
to play-framework
Hi I figured out that the field in the form.html will not be marked in
case of an error.
The reason seems to be that it must be
${errors.forKey('post.title')} instead of ${field.errorClass} because
the field is defined at title. But then the whole concept of the field-
tag is broken.
So I wonder if this could be a better solution:

<p>
#{field 'post.content'}
<label>Write here:</label>
<textarea name="content"
class="${field.errorClass}">${field.value}</textarea>
#{/field}
</p>

Seems to work too, you only have to set name="content", otherwise the
action can't be called correctly.
Is this the optimum or is there a more elegant way?

Niels

GrailsDeveloper

unread,
Aug 13, 2010, 7:03:57 AM8/13/10
to play-framework
Shall I raise an issue in launchpad for this?

On 10 Aug., 19:54, GrailsDeveloper <opensourc...@googlemail.com>
wrote:

Guillaume Bort

unread,
Aug 13, 2010, 11:08:05 AM8/13/10
to play-fr...@googlegroups.com
Well yes. It is a problem of the example. It shouldn't be done this way.

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,
write guillau...@gmail.com

Reply all
Reply to author
Forward
0 new messages