"Fossies" - the Fresh Open Source Software Archive

Member "grails-core-5.2.4/grails-docs/src/test/resources/docs/ref/Tags/eachError.html" (14 Sep 2022, 61622 Bytes) of package /linux/www/grails-core-5.2.4.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the grails-core-5.2.4.tar.gz project site itself.

(Quick Reference)

eachError

Purpose

Loops through each error of the specified bean or model. If no arguments are specified it will loop through all model attributes and check for errors.

Examples

Loop through each error in the "book" bean:

<g:eachError bean="${book}">
    <li>${it}</li>
</g:eachError>

Loop through each error in the title field of the "book" bean:

<g:eachError bean="${book}" field="title">
    <li>${it}</li>
</g:eachError>

Loop through each error in model:

<g:eachError model="${[book1: book1, book2: book2]}" field="title">
    <li>${it}</li>
</g:eachError>

Loop through each error displaying its i18n message:

<g:eachError bean="${book}">
    <li><g:message error="${it}"/></li>
</g:eachError>

Description

Attributes

  • bean (optional) - The instance of the bean to check for errors

  • model (optional) - The name of the model Map to check for errors

  • field (optional) - The field within the bean or model to check for errors for