org.apache.tapestry5.corelib.components

## Class Errors

- java.lang.Object
- - org.apache.tapestry5.corelib.components.Errors

-     public class Errors
      extends Object

  Standard validation error presenter. Must be enclosed by a `Form` component. If errors are present, renders a `<div>` element around a banner message and around an unnumbered list of error messages. Renders nothing if the `ValidationTracker` shows no errors.
  See Also:
    `Form`

  Component Parameters
  Name | Type | Flags | Default | Default Prefix
  --- | --- | --- | --- | ---
  banner | String |  | message:core-default-error-banner | prop
  The banner message displayed above the errors. The default value is "You must correct the following errors before you may continue.".
  class | String |  | symbol:tapestry.errors-default-class-parameter-value | literal
  The CSS class for the div element rendered by the component.
  globalOnly | boolean | Since 5.4 |  | prop
  If true, then only errors global to the form (unassociated with any specific field) are presented. By default all errors (associated with fields, or not) are presented; with unassociated errors presented first.

  ### Examples

    The Errors component automatically connects with the Form that encloses it. Just place the component inside a Form.

    ### Search.tml

        <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
            <body>

            <t:form>

                <t:errors/>

                <t:label for="search"/>
                <t:textfield t:id="search"/>

                <input type="submit" value="Search"/>

            </t:form>

            </body>
        </html>

    The Errors component here will display any validation errors that occur when the form is submitted.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Errors()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `setUpJavaScript()` Hook to set up JavaScript, specifically for handling the close button.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Errors

          public Errors()

  - ### Method Detail

    - #### setUpJavaScript

          protected void setUpJavaScript()

      Hook to set up JavaScript, specifically for handling the close button. Method intended to be overriden when Bootstrap isn't being used. This implementation calls `javaScriptSupport.require("bootstrap/alert");`.
      Since:
        5.5
      See Also:
        `ComponentOverride`

5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.