You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2015/09/09 13:42:55 UTC

tapestry-5 git commit: TAP5-2308: reset the FormFragment's clientId field in the AfterRender phase

Repository: tapestry-5
Updated Branches:
  refs/heads/master 677629acd -> 33f9e65b9


TAP5-2308: reset the FormFragment's clientId field in the AfterRender phase


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/33f9e65b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/33f9e65b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/33f9e65b

Branch: refs/heads/master
Commit: 33f9e65b933654b32d4a67ef6dcbc6b357eb7393
Parents: 677629a
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Wed Sep 9 13:42:00 2015 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Wed Sep 9 13:42:00 2015 +0200

----------------------------------------------------------------------
 .../corelib/components/FormFragment.java        |  2 ++
 .../app1/BeanEditorWithFormFragmentDemo.tml     | 26 +++++++++++---------
 .../app1/BeanEditorWithFormFragmentTests.groovy | 17 ++++++++++++-
 3 files changed, 32 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/33f9e65b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
index 2ee623f..6de0214 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java
@@ -237,6 +237,8 @@ public class FormFragment implements ClientElement
 
 
         environment.pop(FormSupport.class);
+
+        clientId = null;
     }
 
     public String getClientId()

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/33f9e65b/tapestry-core/src/test/app1/BeanEditorWithFormFragmentDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/BeanEditorWithFormFragmentDemo.tml b/tapestry-core/src/test/app1/BeanEditorWithFormFragmentDemo.tml
index 3d8b8dc..12ac795 100644
--- a/tapestry-core/src/test/app1/BeanEditorWithFormFragmentDemo.tml
+++ b/tapestry-core/src/test/app1/BeanEditorWithFormFragmentDemo.tml
@@ -2,18 +2,20 @@
 <h1>Bean Editor With Form Fragment Demo</h1>
 
 	<t:form>
-		<t:beaneditor object="job"
-			include="title,canBeDoneRemotely">
-			<p:canBeDoneRemotely>
-				<t:checkbox t:id="canBeDoneRemotely" value="job.canBeDoneRemotely"
-					t:mixins="triggerfragment" TriggerFragment.fragment="jobAddress" TriggerFragment.invert="true"/>
-				<t:label for="canBeDoneRemotely" />
-			</p:canBeDoneRemotely>
-		</t:beaneditor>
-
-		<t:formfragment t:id="jobAddress" visible="!job.canBeDoneRemotely">
-			<t:beaneditor object="job" include="address" />
-		</t:formfragment>
+		<t:loop source="literal:[1,2]">
+			<t:beaneditor object="job"
+				include="title,canBeDoneRemotely">
+				<p:canBeDoneRemotely>
+					<t:checkbox t:id="canBeDoneRemotely" value="job.canBeDoneRemotely"
+						t:mixins="triggerfragment" TriggerFragment.fragment="jobAddress" TriggerFragment.invert="true"/>
+					<t:label for="canBeDoneRemotely" />
+				</p:canBeDoneRemotely>
+			</t:beaneditor>
+	
+			<t:formfragment t:id="jobAddress" visible="!job.canBeDoneRemotely">
+				<t:beaneditor object="job" include="address" />
+			</t:formfragment>
+		</t:loop>
 	</t:form>
 
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/33f9e65b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BeanEditorWithFormFragmentTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BeanEditorWithFormFragmentTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BeanEditorWithFormFragmentTests.groovy
index 0c81d15..bbd63f8 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BeanEditorWithFormFragmentTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BeanEditorWithFormFragmentTests.groovy
@@ -12,10 +12,25 @@ class BeanEditorWithFormFragmentTests extends GroovyTapestryCoreTestCase
     @Test
     void beaneditor_with_formfragment_and_triggerfragment_mixin()
     {
-        open "/BeanEditorWithFormFragmentDemo"
+        openLinks("Bean Editor With Form Fragment Demo", "Reset Page State")
         assert isVisible("css=#address")
         click "css=#canBeDoneRemotely"
         assert !isVisible("css=#address")
     }
+    
+    /** TAP5-2308 */
+    @Test
+    void beaneditor_with_formfragment_and_triggerfragment_mixin_within_loop()
+    {
+        openLinks("Bean Editor With Form Fragment Demo", "Reset Page State")
+        assert isVisible("css=#address")
+        assert isVisible("css=#address_0")
+        click "css=#canBeDoneRemotely"
+        assert !isVisible("css=#address")
+        assert isVisible("css=#address_0")
+        click "css=#canBeDoneRemotely_0"
+        assert !isVisible("css=#address")
+        assert !isVisible("css=#address_0")
+    }
 
 }