Revision: 600
          http://stripes.svn.sourceforge.net/stripes/?rev=600&view=rev
Author:   bengunter
Date:     2007-08-23 14:47:59 -0700 (Thu, 23 Aug 2007)

Log Message:
-----------
Resolved STS-382: Partial form input fields not registering correctly. Inputs 
register with the first non-partial parent form tag if one is found.

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

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java  
2007-08-16 23:10:00 UTC (rev 599)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/InputTagSupport.java  
2007-08-23 21:47:59 UTC (rev 600)
@@ -29,8 +29,10 @@
 import javax.servlet.jsp.tagext.TryCatchFinally;
 import java.util.Collection;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Locale;
 import java.util.Random;
+import java.util.Stack;
 import java.lang.reflect.Method;
 import java.lang.reflect.Array;
 import java.io.IOException;
@@ -148,6 +150,19 @@
     protected FormTag getParentFormTag() throws StripesJspException {
         FormTag parent = getParentTag(FormTag.class);
 
+        // find the first non-partial parent form tag
+        if (parent != null && parent.isPartial()) {
+            Stack<StripesTagSupport> stack = getTagStack();
+            ListIterator<StripesTagSupport> iter = 
stack.listIterator(stack.size());
+            while (iter.hasPrevious()) {
+                StripesTagSupport tag = iter.previous();
+                if (tag instanceof FormTag && !((FormTag) tag).isPartial()) {
+                    parent = (FormTag) tag;
+                    break;
+                }
+            }
+        }
+
         if (parent == null) {
             throw new StripesJspException
                 ("InputTag of type [" + getClass().getName() + "] must be 
enclosed inside a " +


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to