Author: hlship
Date: Tue Mar 6 10:21:34 2007
New Revision: 515238
URL: http://svn.apache.org/viewvc?view=rev&rev=515238
Log:
TAPESTRY-1320: Render phase BeginRender should respond to a "false" result by
switching to phase AfterRender (rather than phase CleanupRender).
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/BeginRender.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/images/component-render-states.graffle
tapestry/tapestry5/tapestry-core/trunk/src/site/resources/images/component-render-states.png
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/BeginRender.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/BeginRender.java?view=diff&rev=515238&r1=515237&r2=515238
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/BeginRender.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/annotations/BeginRender.java
Tue Mar 6 10:21:34 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 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.
@@ -12,35 +12,36 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.tapestry.annotations;
-
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Marker annotation for methods that should be executed at the start of
rendering the component.
- * This usually includes rendering of the component's start tag.
- * <p>
- * Such methods may optionally take a [EMAIL PROTECTED]
org.apache.tapestry.MarkupWriter} parameter, and may
- * return void or boolean. Returning true or void will allow the component to
advance into the
- * render template / render body phase. If a body is present, the
- * [EMAIL PROTECTED] org.apache.tapestry.annotations.BeforeRenderBody} phase
will execute. If a component has a
- * template, the [EMAIL PROTECTED] BeforeRenderTemplate} phase will execute
(and the render body will only
- * occur if the template directs so).
- * <p>
- * Either way, the [EMAIL PROTECTED]
org.apache.tapestry.annotations.AfterRender} phase will execute after the
- * template and/or body have rendered. A component with a body but without a
template will still see
- * the [EMAIL PROTECTED] org.apache.tapestry.annotations.BeforeRenderBody}
phase execute.
- * <p>
- * Returning false will skip rendering of the template and/or body, and jump
directly to the
- */
[EMAIL PROTECTED](ElementType.METHOD)
[EMAIL PROTECTED](RUNTIME)
[EMAIL PROTECTED]
-public @interface BeginRender {
-
-}
+package org.apache.tapestry.annotations;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Marker annotation for methods that should be executed at the start of
rendering the component.
+ * This usually includes rendering of the component's start tag.
+ * <p>
+ * Such methods may optionally take a [EMAIL PROTECTED]
org.apache.tapestry.MarkupWriter} parameter, and may
+ * return void or boolean. Returning true or void will allow the component to
advance into the
+ * render template / render body phase. If a body is present, the
+ * [EMAIL PROTECTED] org.apache.tapestry.annotations.BeforeRenderBody} phase
will execute. If a component has a
+ * template, the [EMAIL PROTECTED] BeforeRenderTemplate} phase will execute
(and the render body will only
+ * occur if the template directs so).
+ * <p>
+ * Either way, the [EMAIL PROTECTED]
org.apache.tapestry.annotations.AfterRender} phase will execute after the
+ * template and/or body have rendered. A component with a body but without a
template will still see
+ * the [EMAIL PROTECTED] org.apache.tapestry.annotations.BeforeRenderBody}
phase execute.
+ * <p>
+ * Returning false will skip rendering of the template and/or body, and jump
directly to the
+ * [EMAIL PROTECTED] AfterRender} phase.
+ */
[EMAIL PROTECTED](ElementType.METHOD)
[EMAIL PROTECTED](RUNTIME)
[EMAIL PROTECTED]
+public @interface BeginRender {
+
+}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java?view=diff&rev=515238&r1=515237&r2=515238
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
Tue Mar 6 10:21:34 2007
@@ -337,15 +337,14 @@
invoke(false, callback);
+ queue.push(_afterRender);
+
// If the component has no template whatsoever, then a
// renderBody element is added as the lone element of the
component's template.
// So every component will have a non-empty template.
if (handler.getResult())
- {
- queue.push(_afterRender);
queue.push(_beforeRenderTemplate);
- }
handler.queueCommands(queue);
}
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt?view=diff&rev=515238&r1=515237&r2=515238
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt
(original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt
Tue Mar 6 10:21:34 2007
@@ -83,7 +83,7 @@
+---+
public class Login
{
- @Retain
+ @Persist
private String _userName;
private String _password;
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/site/images/component-render-states.graffle
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/images/component-render-states.graffle?view=diff&rev=515238&r1=515237&r2=515238
==============================================================================
---
tapestry/tapestry5/tapestry-core/trunk/src/site/images/component-render-states.graffle
(original)
+++
tapestry/tapestry5/tapestry-core/trunk/src/site/images/component-render-states.graffle
Tue Mar 6 10:21:34 2007
@@ -815,7 +815,7 @@
</dict>
<dict>
<key>Bounds</key>
- <string>{{495.019, 260.866}, {36, 14}}</string>
+ <string>{{493.307, 260.272}, {36, 14}}</string>
<key>Class</key>
<string>ShapedGraphic</string>
<key>FitText</key>
@@ -1139,7 +1139,7 @@
<key>Head</key>
<dict>
<key>ID</key>
- <integer>13</integer>
+ <integer>12</integer>
</dict>
<key>ID</key>
<integer>67</integer>
@@ -1148,7 +1148,7 @@
<string>{479.795, 253.125}</string>
<string>{604, 329}</string>
<string>{625.997, 582}</string>
- <string>{583.358, 840.009}</string>
+ <string>{485.209, 756.836}</string>
</array>
<key>Style</key>
<dict>
@@ -2635,7 +2635,7 @@
</dict>
</array>
<key>ModificationDate</key>
- <string>2007-02-19 13:13:13 -0800</string>
+ <string>2007-03-06 10:15:03 -0800</string>
<key>Modifier</key>
<string>Howard Lewis Ship</string>
<key>NotesVisible</key>
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/site/resources/images/component-render-states.png
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/resources/images/component-render-states.png?view=diff&rev=515238&r1=515237&r2=515238
==============================================================================
Binary files - no diff available.