Author: tawus
Date: Sun Nov  6 13:38:17 2011
New Revision: 1198362

URL: http://svn.apache.org/viewvc?rev=1198362&view=rev
Log:
TAP5-1742: AfterRender returns null instead of true when the loop is done 
iterating

Modified:
    
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Loop.java
    
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/LoopTest.java
    
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/LoopTests.java
    
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java

Modified: 
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Loop.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Loop.java?rev=1198362&r1=1198361&r2=1198362&view=diff
==============================================================================
--- 
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Loop.java
 (original)
+++ 
tapestry/tapestry5/branches/5.3/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Loop.java
 Sun Nov  6 13:38:17 2011
@@ -422,7 +422,7 @@ public class Loop<T>
      * Ends the current heartbeat.
      */
     @AfterRender
-    boolean after(MarkupWriter writer)
+    Boolean after(MarkupWriter writer)
     {
         if (element != null)
             writer.end();
@@ -434,7 +434,7 @@ public class Loop<T>
             formSupport.store(this, END_HEARTBEAT);
         }
 
-        return !iterator.hasNext();
+        return iterator.hasNext() ? false : null;
     }
 
     private void endHeartbeat()

Modified: 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/LoopTest.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/LoopTest.java?rev=1198362&r1=1198361&r2=1198362&view=diff
==============================================================================
--- 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/LoopTest.java
 (original)
+++ 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/corelib/components/LoopTest.java
 Sun Nov  6 13:38:17 2011
@@ -65,7 +65,7 @@ public class LoopTest extends InternalBa
         assertEquals(loop.getValue(), "gamma");
         assertEquals(loop.getIndex(), 2);
 
-        assertTrue(loop.after(writer));
+        assertNull(loop.after(writer));
 
         verify();
     }

Modified: 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/LoopTests.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/LoopTests.java?rev=1198362&r1=1198361&r2=1198362&view=diff
==============================================================================
--- 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/LoopTests.java
 (original)
+++ 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/LoopTests.java
 Sun Nov  6 13:38:17 2011
@@ -98,4 +98,14 @@ public class LoopTests extends TapestryC
         assertFieldValue("title_1", "Cure Common Cold - post haste");
         assertFieldValue("title_2", "Conquer World");
     }
+
+    @Test
+    public void 
after_render_does_not_shortcut_other_after_render_phase_methods() throws 
Exception{
+        openLinks("Loop With Mixin Demo");
+
+        assertTextPresent("BEGIN-TRACER-MIXIN");
+        assertTextPresent("123456");
+        assertTextPresent("123457");
+        assertTextPresent("AFTER-TRACER-MIXIN");
+    }
 }

Modified: 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=1198362&r1=1198361&r2=1198362&view=diff
==============================================================================
--- 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
 (original)
+++ 
tapestry/tapestry5/branches/5.3/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
 Sun Nov  6 13:38:17 2011
@@ -175,6 +175,9 @@ public class Index
                     new Item("GenericLoopDemo", "Generic Loop Demo",
                             "Use of generic parameters with the Loop 
component."),
 
+                    new Item("LoopWithMixinDemo", "Loop With Mixin Demo",
+                        "Use a mixin with a Loop component."),
+
                     new Item("BlankPasswordDemo", "Blank Password Demo",
                             "Show that a blank value in a PasswordField does 
not update the server side value."),
 


Reply via email to