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/11/05 21:40:51 UTC

svn commit: r1031782 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/resources/org/apache/tapestry5/ test/app1/nested/ test/java/org/apache/tapestry5/integration/app1/pages/nested/

Author: hlship
Date: Fri Nov  5 20:40:51 2010
New Revision: 1031782

URL: http://svn.apache.org/viewvc?rev=1031782&view=rev
Log:
TAP5-1332: In a multi-zone update, if the referenced Zone can not be found on the client, Tapestry stops updating Zones with no error

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages.js
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages_de.js
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages.js?rev=1031782&r1=1031781&r2=1031782&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages.js Fri Nov  5 20:40:51 2010
@@ -1,4 +1,4 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ Tapestry.Messages = {
 
     missingZone :   "Unable to locate Ajax Zone '#{id}' for dynamic update.",
 
-    noZoneManager :   "Ajax Zone '#{id}' does not have an associated Tapestry.ZoneManager object." ,
+    noZoneManager :   "Element '#{id}' does not have an associated Tapestry.ZoneManager object." ,
 
     pathDoesNotStartWithSlash : "External path #{path} does not start with a leading slash.",
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages_de.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages_de.js?rev=1031782&r1=1031781&r2=1031782&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages_de.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry-messages_de.js Fri Nov  5 20:40:51 2010
@@ -1,4 +1,4 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ Tapestry.Messages = {
 
     missingZone :   "Ajax Zone '#{id}' konnte für ein dynamisches Update nicht gefunden werden.",
 
-    noZoneManager :   "Ajax Zone '#{id}' ist nicht mit einem Tapestry.ZoneManager Objekt verknüpft." ,
+    noZoneManager :   "Element '#{id}' ist nicht mit einem Tapestry.ZoneManager Objekt verknüpft." ,
 
     pathDoesNotStartWithSlash : "Der externe Pfad #{path} beginnt nicht mit einem führenden '/'.",
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js?rev=1031782&r1=1031781&r2=1031782&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js Fri Nov  5 20:40:51 2010
@@ -473,14 +473,14 @@ var Tapestry = {
 	findZoneManagerForZone : function(zoneElement) {
 		var element = $(zoneElement);
 
-		if (!zoneElement) {
+		if (!element) {
 			Tapestry.error(Tapestry.Messages.missingZone, {
 				id : zoneElement
 			});
 			return null;
 		}
 
-		var manager = $T(zoneElement).zoneManager;
+		var manager = $T(element).zoneManager;
 
 		if (!manager) {
 			Tapestry.error(Tapestry.Messages.noZoneManager, element);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml?rev=1031782&r1=1031781&r2=1031782&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml Fri Nov  5 20:40:51 2010
@@ -75,10 +75,31 @@
       <t:actionlink t:id="poorlyFormattedFail" zone="output">Poorly formatted server-side
         failure</t:actionlink>
     </li>
+    <li>
+      <t:actionlink t:id="badZone" zone="output">
+        MultiZone update with unknown id
+      </t:actionlink>
+    </li>
+    <li>
+      <t:actionlink t:id="nonZoneUpdate" zone="output">
+        MultiZone update with id of non-Zone
+        element
+      </t:actionlink>
+    </li>
   </ul>
 
+  <div id="notAZone"/>
+
   <t:block id="empty"/>
 
+  <t:block id="forUnknownZone">
+    <p>Content for the unknown zone.</p>
+  </t:block>
+
+  <t:block id="forNotAZone">
+    <p>Content for zone update for a non-Zone element.</p>
+  </t:block>
+
   <div id="zone-update-message"/>
 
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java?rev=1031782&r1=1031781&r2=1031782&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java Fri Nov  5 20:40:51 2010
@@ -18,6 +18,7 @@ import org.apache.tapestry5.Block;
 import org.apache.tapestry5.QueryParameterConstants;
 import org.apache.tapestry5.RenderSupport;
 import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.ajax.MultiZoneUpdate;
 import org.apache.tapestry5.annotations.*;
 import org.apache.tapestry5.corelib.components.BeanEditForm;
 import org.apache.tapestry5.corelib.components.Zone;
@@ -43,7 +44,7 @@ public class ZoneDemo
     { "Fred & Wilma", "Mr. <Roboto>", "Grim Fandango", "Registration", "Vote" };
 
     @Inject
-    private Block registrationForm, registrationOutput, voteForm, voteOutput, empty;
+    private Block registrationForm, registrationOutput, voteForm, voteOutput, empty, forUnknownZone, forNotAZone;
 
     @Property
     private String vote;
@@ -99,7 +100,7 @@ public class ZoneDemo
     {
         throw new RuntimeException("Failure &\n\n<Stuff>!");
     }
-    
+
     Object onSuccessFromRegistrationForm()
     {
         return registrationOutput;
@@ -161,7 +162,7 @@ public class ZoneDemo
     {
         return securePage;
     }
-    
+
     Object onActionFromBlankUpdate()
     {
         return empty;
@@ -174,4 +175,14 @@ public class ZoneDemo
                         "$('%s').observe(Tapestry.ZONE_UPDATED_EVENT, function() { $('zone-update-message').update('Zone updated.'); });",
                         output.getClientId());
     }
+
+    Object onActionFromBadZone()
+    {
+        return new MultiZoneUpdate("unknownZone", forUnknownZone);
+    }
+
+    Object onActionFromNonZoneUpdate()
+    {
+        return new MultiZoneUpdate("notAZone", forNotAZone);
+    }
 }