You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2010/01/02 04:01:05 UTC

svn commit: r895113 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java

Author: hlship
Date: Sat Jan  2 03:01:05 2010
New Revision: 895113

URL: http://svn.apache.org/viewvc?rev=895113&view=rev
Log:
TAP5-962: Errors component includes an @Environmental for FormSupport, but doesn't use it

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java?rev=895113&r1=895112&r2=895113&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java Sat Jan  2 03:01:05 2010
@@ -25,14 +25,17 @@
 import java.util.List;
 
 /**
- * Standard validation error presenter. Must be enclosed by a {@link org.apache.tapestry5.corelib.components.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 {@link org.apache.tapestry5.ValidationTracker} shows no errors.
+ * Standard validation error presenter. Must be enclosed by a
+ * {@link org.apache.tapestry5.corelib.components.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 {@link 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
+     * The banner message displayed above the errors. The default value is "You must correct the
+     * following errors before
      * you may continue.".
      */
     @Parameter("message:default-banner")
@@ -48,14 +51,13 @@
     @Environmental(false)
     private ValidationTracker tracker;
 
-    @Environmental
-    private FormSupport formSupport;
-
     void beginRender(MarkupWriter writer)
     {
-        if (tracker == null) throw new RuntimeException(InternalMessages.encloseErrorsInForm());
+        if (tracker == null)
+            throw new RuntimeException(InternalMessages.encloseErrorsInForm());
 
-        if (!tracker.getHasErrors()) return;
+        if (!tracker.getHasErrors())
+            return;
 
         writer.element("div", "class", className);