Author: kaosko
Date: Thu Mar 29 19:07:54 2012
New Revision: 1307062
URL: http://svn.apache.org/viewvc?rev=1307062&view=rev
Log:
RESOLVED - TAP5-1890: PlaceholderBlock should implement RenderCommand
- apply Dragan Sahpaski's patch, including tests, without changes
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ZoneDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
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/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java?rev=1307062&r1=1307061&r2=1307062&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ComponentPageElementImpl.java
Thu Mar 29 19:07:54 2012
@@ -63,12 +63,16 @@ public class ComponentPageElementImpl ex
/**
* Placeholder for the body used when the component has no real content.
*/
- private static class PlaceholderBlock implements Block, Renderable
+ private static class PlaceholderBlock implements Block, Renderable,
RenderCommand
{
public void render(MarkupWriter writer)
{
}
+ public void render(MarkupWriter writer, RenderQueue queue)
+ {
+ }
+
@Override
public String toString()
{
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=1307062&r1=1307061&r2=1307062&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
Thu Mar 29 19:07:54 2012
@@ -82,6 +82,9 @@
<t:actionlink t:id="blankUpdate" zone="output">Blank the
zone</t:actionlink>
</li>
<li>
+ <t:actionLink t:id="updateZoneWithEmptyBody"
zone="output">Update zone with empty body</t:actionLink>
+ </li>
+ <li>
<t:actionlink t:id="poorlyFormattedFail" zone="output">Poorly
formatted server-side
failure
</t:actionlink>
@@ -102,6 +105,8 @@
<div id="notAZone"/>
<t:block id="empty"/>
+
+ <t:zone t:id="zoneWithEmptyBody"/>
<t:block id="forUnknownZone">
<p>Content for the unknown zone.</p>
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java?rev=1307062&r1=1307061&r2=1307062&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
Thu Mar 29 19:07:54 2012
@@ -337,5 +337,24 @@ public class ZoneTests extends TapestryC
assertCSS("demo-aip", "color", "rgb(0, 128, 0)");
assertCSS("demo-aip", "text-decoration", "underline");
}
+
+ /**
+ * TAP5-1890
+ */
+ @Test
+ public void update_zone_with_empty_body()
+ {
+ openLinks("Zone Demo");
+
+ assertText("zone-update-message", "");
+
+ click("link=Update zone with empty body");
+
+ // Give it some time to process.
+
+ sleep(100);
+
+ assertText("zone-update-message", "Zone updated.");
+ }
}
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=1307062&r1=1307061&r2=1307062&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
Thu Mar 29 19:07:54 2012
@@ -57,6 +57,9 @@ public class ZoneDemo
@InjectComponent
private Zone output;
+ @InjectComponent
+ private Zone zoneWithEmptyBody;
+
@InjectPage
private SecurePage securePage;
@@ -200,7 +203,12 @@ public class ZoneDemo
{
return empty;
}
-
+
+ Object onActionFromUpdateZoneWithEmptyBody()
+ {
+ return zoneWithEmptyBody.getBody();
+ }
+
void afterRender()
{
jss.importStylesheet(new StylesheetLink(overridesCSS, new
StylesheetOptions().asAjaxInsertionPoint()));