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/04/05 22:34:42 UTC

svn commit: r930954 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java

Author: hlship
Date: Mon Apr  5 20:34:42 2010
New Revision: 930954

URL: http://svn.apache.org/viewvc?rev=930954&view=rev
Log:
TAP5-1096: If a Zone's id parameter is bound, then the clientId property should return that value, even before the Zone renders

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java?rev=930954&r1=930953&r2=930954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java Mon Apr  5 20:34:42 2010
@@ -21,6 +21,7 @@ import org.apache.tapestry5.ClientElemen
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.MarkupWriter;
 import org.apache.tapestry5.QueryParameterConstants;
+import org.apache.tapestry5.annotations.BeginRender;
 import org.apache.tapestry5.annotations.Environmental;
 import org.apache.tapestry5.annotations.Parameter;
 import org.apache.tapestry5.annotations.SupportsInformalParameters;
@@ -154,12 +155,17 @@ public class Zone implements ClientEleme
 
     /**
      * The client id of the Zone; this is set when the Zone renders and will either be the value bound to the id
-     * parameter, or an allocated unique id.
+     * parameter, or an allocated unique id. When the id parameter is bound, this value is always accurate.
+     * When the id parameter is not bound, the clientId is set during the {@linkplain BeginRender begin render phase}
+     * and will be null or innacurate before then.
      * 
      * @return client-side element id
      */
     public String getClientId()
     {
+        if (resources.isBound("id"))
+            return idParameter;
+
         return clientId;
     }