Revision: 865
          http://stripes.svn.sourceforge.net/stripes/?rev=865&view=rev
Author:   mongus
Date:     2008-02-26 17:22:35 -0800 (Tue, 26 Feb 2008)

Log Message:
-----------
Tag reuse by a servlet container within the same form was causing attributes 
set in one tag to show up in following tags. The code now calls release after 
the tag is rendered to clear it out.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
    trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java 
2008-02-26 01:06:05 UTC (rev 864)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/FieldMetadataTag.java 
2008-02-27 01:22:35 UTC (rev 865)
@@ -397,4 +397,15 @@
             return formId;
         }
     }
+
+    /** Release method to clean up the state of the tag to prepare it for 
re-use. */
+    @Override
+    public void release() {
+        // Because the type attribute is set in the constructor and
+        // the attributes are cleared we need to save the type and
+        // replace it after calling super.release().
+        String type = getAttributes().get("type");
+        super.release();
+        getAttributes().put("type", type);
+    }
 }

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java  
2008-02-26 01:06:05 UTC (rev 864)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java  
2008-02-27 01:22:35 UTC (rev 865)
@@ -438,13 +438,26 @@
             return result;
         }
         finally {
-            this.errorRenderer = null;
-            this.fieldErrors = null;
-            this.fieldErrorsLoaded = false;
-            this.focus = false;
+            this.release();
         }
     }
+    
+    /** Release method to clean up the state of the tag ready for re-use. */
+    @Override
+    public void release() {
+        this.errorRenderer = null;
+        this.fieldErrors = null;
+        this.fieldErrorsLoaded = false;
+        this.focus = false;
 
+        // Because the type attribute is set in the constructor and
+        // the attributes are cleared we need to save the type and
+        // replace it after calling super.release().
+        String type = getAttributes().get("type");
+        super.release();
+        getAttributes().put("type", type);
+    }
+
     /** Rethrows the passed in throwable in all cases. */
     public void doCatch(Throwable throwable) throws Throwable { throw 
throwable; }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to