Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Copyright 2006, 2007, 2008 The Apache Software Foundation
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package org.apache.tapestry5.corelib.components;
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 org.apache.tapestry5.ValidationTracker shows no errors.
public class Errors
The banner message displayed above the errors. The default value is "You must correct the following errors before you may continue.".
    private String banner;

The CSS class for the div element rendered by the component. The default value is "t-error".
    @Parameter(name = "class")
    private String className = .;
    // Allow null so we can generate a better error message if missing
    private ValidationTracker tracker;
    void beginRender(MarkupWriter writer)
        if ( == null)
            throw new RuntimeException(InternalMessages.encloseErrorsInForm());
        if (!.getHasErrors())
        // Inner div for the banner text
        List<Stringerrors = .getErrors();
        if (!errors.isEmpty())
            // Only write out the <UL> if it will contain <LI> elements. An empty <UL> is not
            // valid XHTML.
            for (String message : errors)
            writer.end(); // ul
        writer.end(); // div
New to GrepCode? Check out our FAQ X