You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2014/05/06 11:30:14 UTC
[1/2] git commit: use
org.apache.tapestry5.test.SeleniumTestCase.waitForAjaxRequestsToComplete()
instead of sleeping for a fixed amount of time
Repository: tapestry-5
Updated Branches:
refs/heads/master 4d45afaf2 -> 14524fecd
use org.apache.tapestry5.test.SeleniumTestCase.waitForAjaxRequestsToComplete() instead of sleeping for a fixed amount of time
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/6a63e750
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/6a63e750
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/6a63e750
Branch: refs/heads/master
Commit: 6a63e750ed8d245b83199d04d79b28eb3076603b
Parents: 4d45afa
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Tue May 6 09:03:45 2014 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Tue May 6 09:03:45 2014 +0200
----------------------------------------------------------------------
.../tapestry5/integration/app1/AlertsTests.groovy | 4 ++--
.../tapestry5/integration/TapestryCoreTestCase.java | 4 ++++
.../apache/tapestry5/integration/app1/AjaxTests.java | 8 ++++----
.../apache/tapestry5/integration/app1/CacheTests.java | 2 +-
.../apache/tapestry5/integration/app1/FormTests.java | 6 +++---
.../apache/tapestry5/integration/app1/GridTests.java | 4 ++--
.../tapestry5/integration/app1/ZoneRefreshTest.java | 4 ++--
.../apache/tapestry5/integration/app1/ZoneTests.java | 12 ++++++------
8 files changed, 24 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
index ed540cd..4cf2aa9 100644
--- a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy
@@ -49,7 +49,7 @@ class AlertsTests extends App1TestCase {
click "css=$CONTAINER button.close"
- sleep AJAX_WAIT_TIME
+ waitForAjaxRequestsToComplete()
// Check that the alert container is now empty
@@ -146,7 +146,7 @@ class AlertsTests extends App1TestCase {
click "//input[@value='Ajax Update']"
- sleep AJAX_WAIT_TIME
+ waitForAjaxRequestsToComplete()
waitForCSSSelectedElementToAppear "div.t-error"
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
index fb54010..1c3baa7 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
@@ -24,6 +24,10 @@ public abstract class TapestryCoreTestCase extends SeleniumTestCase
public static final String TEST_APP_BANNER = "Tapestry Integration Test Application";
// Rule of thumb time, in ms, to wait for Ajax to occur.
+ /**
+ *@deprecated Use {@link #waitForAjaxRequestsToComplete()}
+ */
+ @Deprecated
public static final int AJAX_WAIT_TIME = 250;
protected final void assertTextSeries(String idFormat, int startIndex, String... values)
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
index 528054f..956b3fb 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java
@@ -185,7 +185,7 @@ public class AjaxTests extends App1TestCase
click("link=Add another value");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
type("//input[@type='text'][1]", "5.1");
@@ -195,7 +195,7 @@ public class AjaxTests extends App1TestCase
click("link=remove");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
clickAndWait(SUBMIT);
@@ -211,7 +211,7 @@ public class AjaxTests extends App1TestCase
click("link=Add another value");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
type("//input[@type='text'][1]", "5.1");
@@ -221,7 +221,7 @@ public class AjaxTests extends App1TestCase
click("css=.glyphicon-trash");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
clickAndWait(SUBMIT);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CacheTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CacheTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CacheTests.java
index 6f9cb2a..6dccd83 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CacheTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CacheTests.java
@@ -35,7 +35,7 @@ public class CacheTests extends App1TestCase
click("link=update");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
String time2_1 = getText("time1");
String time2_2 = getText("time1");
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
index b0bf953..15b3af5 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
@@ -205,7 +205,7 @@ public class FormTests extends App1TestCase
click("css=.x-birthday .btn");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertText("//A[@class='topLabel']", "1966 d\u00e9cembre");
}
@@ -243,7 +243,7 @@ public class FormTests extends App1TestCase
click("css=.x-impact .btn");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertSourcePresent("Unparseable date: \"<script>alert('T5 is great'); </script>\"");
}
@@ -374,7 +374,7 @@ public class FormTests extends App1TestCase
//immediately after picking the month label, so we sleep the test for a few seconds to provide
//ammple time for the bug to manifest.
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertTrue(isVisible("css=div.datePicker"));
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
index 37407e5..1a55695 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
@@ -273,11 +273,11 @@ public class GridTests extends App1TestCase
String timestamp = getText("lastupdate");
click("link=2");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
click("link=Album");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertEquals(getText("lastupdate"), timestamp,
"Timestamp should not have changed because updates are in-place.");
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
index 51bc760..c18890c 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneRefreshTest.java
@@ -27,7 +27,7 @@ public class ZoneRefreshTest extends App1TestCase
clickAndWait("link=Zone Refresh With Event Handler Returning Void");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
checkZoneValues("zone", 3);
}
@@ -39,7 +39,7 @@ public class ZoneRefreshTest extends App1TestCase
clickAndWait("link=Zone Refresh With Event Handler Returning Zone");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
checkZoneValues("zone", 3);
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/6a63e750/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
index e2497a7..b997e03 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ZoneTests.java
@@ -33,7 +33,7 @@ public class ZoneTests extends App1TestCase
select("carMaker", "Bmw");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
click(SUBMIT);
@@ -51,7 +51,7 @@ public class ZoneTests extends App1TestCase
select("carMaker", "Mercedes");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
select(selectLocator, "E-Class");
@@ -71,7 +71,7 @@ public class ZoneTests extends App1TestCase
click("link=Select \"Mr. <Roboto>\"");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertTextPresent("Selected: Mr. <Roboto>");
@@ -141,7 +141,7 @@ public class ZoneTests extends App1TestCase
click(SUBMIT);
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
waitForElementToAppear("message");
@@ -162,7 +162,7 @@ public class ZoneTests extends App1TestCase
// Give it some time to process.
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertText("zone-update-message", "Zone updated.");
}
@@ -318,7 +318,7 @@ public class ZoneTests extends App1TestCase
click("link=Update zone with empty body");
- sleep(AJAX_WAIT_TIME);
+ waitForAjaxRequestsToComplete();
assertText("zone-update-message", "Zone updated.");
}
[2/2] git commit: TAP5-2256: reset the zone to null in the setup
render phase,
fixes zone element being rendered only for the first iteration of a loop
Posted by jk...@apache.org.
TAP5-2256: reset the zone to null in the setup render phase, fixes zone element being rendered only for the first iteration of a loop
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/14524fec
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/14524fec
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/14524fec
Branch: refs/heads/master
Commit: 14524fecd3da310db41fee71f9bd3cb9eb22efa8
Parents: 6a63e75
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Tue May 6 11:13:50 2014 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Tue May 6 11:26:55 2014 +0200
----------------------------------------------------------------------
.../tapestry5/corelib/components/Grid.java | 2 ++
.../src/test/app1/InplaceGridInLoopDemo.tml | 22 ++++++++++++++++
.../tapestry5/integration/app1/GridTests.java | 20 +++++++++++++++
.../tapestry5/integration/app1/pages/Index.java | 4 ++-
.../app1/pages/InplaceGridInLoopDemo.java | 27 ++++++++++++++++++++
5 files changed, 74 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
index 2a37214..dd3fda4 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
@@ -440,6 +440,8 @@ public class Grid implements GridModel, ClientElement
Object setupRender()
{
+ zone = null;
+
if (formSupport != null)
formSupport.store(this, SETUP_DATA_SOURCE);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml b/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml
new file mode 100644
index 0000000..e12609b
--- /dev/null
+++ b/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml
@@ -0,0 +1,22 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <h1>In-Place Grid in a Loop Demo</h1>
+
+ <t:loop source="[1,2]" value="index">
+ <t:any class="prop:containerclass">
+ <table t:type="grid" t:id="grid" source="tracks" row="track" inplace="true" rowsPerPage="5">
+ <t:parameter name="ratingheader">
+ <t:actionlink t:id="sortRating">Sort Rating</t:actionlink>
+ </t:parameter>
+ <t:parameter name="ratingcell">
+ <t:outputRating rating="track.rating"/>
+ </t:parameter>
+ </table>
+ </t:any>
+ </t:loop>
+
+ <p>
+ [<t:actionlink t:id="reset">reset the Grids</t:actionlink>]
+ </p>
+
+</html>
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
index 1a55695..2d5f7b3 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
@@ -332,4 +332,24 @@ public class GridTests extends App1TestCase
assertAttribute("//a[contains(@href,'columns:sort')]/@rel", "nofollow");
}
+ /**
+ * TAP5-2256
+ */
+ @Test
+ public void sorting_inplace_grid_in_a_loop()
+ {
+ openLinks("In-Place Grid in a Loop Demo", "reset the Grids");
+
+ click("css=.grid1 th[data-grid-property='title'] a");
+ waitForAjaxRequestsToComplete();
+ click("css=.grid2 th[data-grid-property='album'] a");
+ waitForAjaxRequestsToComplete();
+ assertAttribute("css=.grid1 th[data-grid-property='title']/@data-grid-column-sort", "ascending");
+ assertAttribute("css=.grid2 th[data-grid-property='album']/@data-grid-column-sort", "ascending");
+ assertAttribute("css=.grid2 th[data-grid-property='title']/@data-grid-column-sort", "sortable");
+
+
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index bfd68f3..b516ef7 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -561,7 +561,9 @@ public class Index
new Item("PartialTemplateRendererDemo", "PartialTemplateRenderer Demo", "Shows some examples of rendering blocks and components to a String using PartialTemplateRenderer"),
- new Item("nested/PageThatThrowsException", "Reload on nested page", "Tests a page reload from a nested page's exception report")
+ new Item("nested/PageThatThrowsException", "Reload on nested page", "Tests a page reload from a nested page's exception report"),
+
+ new Item("inplacegridinloopdemo", "In-Place Grid in a Loop Demo", "In-place grid in a loop")
);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java
new file mode 100644
index 0000000..6337cec
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java
@@ -0,0 +1,27 @@
+// Copyright 2008, 2011 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.integration.app1.pages;
+
+import org.apache.tapestry5.annotations.Property;
+
+public class InplaceGridInLoopDemo extends GridDemo {
+
+ @Property
+ private int index;
+
+ public String getContainerClass() {
+ return "grid" + index;
+ }
+}
[2/2] git commit: TAP5-2256: reset the zone to null in the setup
render phase,
fixes zone element being rendered only for the first iteration of a loop
Posted by jk...@apache.org.
TAP5-2256: reset the zone to null in the setup render phase, fixes zone element being rendered only for the first iteration of a loop
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/14524fec
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/14524fec
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/14524fec
Branch: refs/heads/master
Commit: 14524fecd3da310db41fee71f9bd3cb9eb22efa8
Parents: 6a63e75
Author: Jochen Kemnade <jo...@eddyson.de>
Authored: Tue May 6 11:13:50 2014 +0200
Committer: Jochen Kemnade <jo...@eddyson.de>
Committed: Tue May 6 11:26:55 2014 +0200
----------------------------------------------------------------------
.../tapestry5/corelib/components/Grid.java | 2 ++
.../src/test/app1/InplaceGridInLoopDemo.tml | 22 ++++++++++++++++
.../tapestry5/integration/app1/GridTests.java | 20 +++++++++++++++
.../tapestry5/integration/app1/pages/Index.java | 4 ++-
.../app1/pages/InplaceGridInLoopDemo.java | 27 ++++++++++++++++++++
5 files changed, 74 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
index 2a37214..dd3fda4 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Grid.java
@@ -440,6 +440,8 @@ public class Grid implements GridModel, ClientElement
Object setupRender()
{
+ zone = null;
+
if (formSupport != null)
formSupport.store(this, SETUP_DATA_SOURCE);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml b/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml
new file mode 100644
index 0000000..e12609b
--- /dev/null
+++ b/tapestry-core/src/test/app1/InplaceGridInLoopDemo.tml
@@ -0,0 +1,22 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <h1>In-Place Grid in a Loop Demo</h1>
+
+ <t:loop source="[1,2]" value="index">
+ <t:any class="prop:containerclass">
+ <table t:type="grid" t:id="grid" source="tracks" row="track" inplace="true" rowsPerPage="5">
+ <t:parameter name="ratingheader">
+ <t:actionlink t:id="sortRating">Sort Rating</t:actionlink>
+ </t:parameter>
+ <t:parameter name="ratingcell">
+ <t:outputRating rating="track.rating"/>
+ </t:parameter>
+ </table>
+ </t:any>
+ </t:loop>
+
+ <p>
+ [<t:actionlink t:id="reset">reset the Grids</t:actionlink>]
+ </p>
+
+</html>
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
index 1a55695..2d5f7b3 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
@@ -332,4 +332,24 @@ public class GridTests extends App1TestCase
assertAttribute("//a[contains(@href,'columns:sort')]/@rel", "nofollow");
}
+ /**
+ * TAP5-2256
+ */
+ @Test
+ public void sorting_inplace_grid_in_a_loop()
+ {
+ openLinks("In-Place Grid in a Loop Demo", "reset the Grids");
+
+ click("css=.grid1 th[data-grid-property='title'] a");
+ waitForAjaxRequestsToComplete();
+ click("css=.grid2 th[data-grid-property='album'] a");
+ waitForAjaxRequestsToComplete();
+ assertAttribute("css=.grid1 th[data-grid-property='title']/@data-grid-column-sort", "ascending");
+ assertAttribute("css=.grid2 th[data-grid-property='album']/@data-grid-column-sort", "ascending");
+ assertAttribute("css=.grid2 th[data-grid-property='title']/@data-grid-column-sort", "sortable");
+
+
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index bfd68f3..b516ef7 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -561,7 +561,9 @@ public class Index
new Item("PartialTemplateRendererDemo", "PartialTemplateRenderer Demo", "Shows some examples of rendering blocks and components to a String using PartialTemplateRenderer"),
- new Item("nested/PageThatThrowsException", "Reload on nested page", "Tests a page reload from a nested page's exception report")
+ new Item("nested/PageThatThrowsException", "Reload on nested page", "Tests a page reload from a nested page's exception report"),
+
+ new Item("inplacegridinloopdemo", "In-Place Grid in a Loop Demo", "In-place grid in a loop")
);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/14524fec/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java
new file mode 100644
index 0000000..6337cec
--- /dev/null
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/InplaceGridInLoopDemo.java
@@ -0,0 +1,27 @@
+// Copyright 2008, 2011 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry5.integration.app1.pages;
+
+import org.apache.tapestry5.annotations.Property;
+
+public class InplaceGridInLoopDemo extends GridDemo {
+
+ @Property
+ private int index;
+
+ public String getContainerClass() {
+ return "grid" + index;
+ }
+}