tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject [2/3] tapestry-5 git commit: Base form control names of component's id, not allocated client-side id
Date Tue, 07 Apr 2015 23:39:05 GMT
Base form control names of component's id, not allocated client-side id


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/22bd2c14
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/22bd2c14
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/22bd2c14

Branch: refs/heads/master
Commit: 22bd2c14b3c7d91ebd97cbc264882552c12044f7
Parents: c9aa3cb
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Tue Apr 7 16:23:42 2015 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Tue Apr 7 16:23:42 2015 -0700

----------------------------------------------------------------------
 54_RELEASE_NOTES.md                                | 17 ++++++++---------
 .../tapestry5/corelib/base/AbstractField.java      |  2 +-
 .../tapestry5/integration/app1/AlertsTests.groovy  |  8 ++++----
 .../integration/app1/pages/ZoneFormDemo.tml        |  2 +-
 4 files changed, 14 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/22bd2c14/54_RELEASE_NOTES.md
----------------------------------------------------------------------
diff --git a/54_RELEASE_NOTES.md b/54_RELEASE_NOTES.md
index 3c543e1..9181675 100644
--- a/54_RELEASE_NOTES.md
+++ b/54_RELEASE_NOTES.md
@@ -151,15 +151,14 @@ never, or always.
 
 As of version 5.4, Tapestry requires Java 1.6 at least.
 
-## clientId required for Ajax field decoration
-
-Applications that perform server-side validation of form control data (such as TextField)
*as part of
-an Ajax Zone update* should bind the Zone's simpleIds parameter to true. This disables the
injection of a per-request
-unique id into allocated client-side ids and client-side control names.
-
-Non-Ajax requests are not affected.  Client-side validation is not affected. Only the rare
case where validation
-only occurs on the server is affected; Tapestry has lost the ability to coordinate the Tapestry-generated
id
-for the field (this is related to big improvements in rendering described below).
+## Form Control names
+
+The rules for how a form control's name attribute is generated on the server has changed;
previously, it was
+based on the field component's client-side id.  It is now based on the component's simple
Tapestry id.
+ 
+As before, the id is made unique with an optional numeric suffix; however with this change
it is possible,
+in some complex Ajax-related cases (involving FormFragment or FormInjector components) for
there to be name
+collisions that were not possible before.
 
 ## Charset for Assets
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/22bd2c14/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
index cd56f3c..cce49e4 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
@@ -194,7 +194,7 @@ public abstract class AbstractField implements Field
 
         assignedClientId = allocateClientId();
 
-        String controlName = formSupport.allocateControlName(assignedClientId);
+        String controlName = formSupport.allocateControlName(resources.getId());
 
         formSupport.storeAndExecute(this, new Setup(controlName));
         formSupport.store(this, PROCESS_SUBMISSION_ACTION);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/22bd2c14/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 081445b..ec441c9 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
@@ -97,10 +97,10 @@ class AlertsTests extends App1TestCase {
     void ajax_update_and_remove() {
         openLinks "Alerts Demo", "Reset Alerts Storage"
 
-        def severitySelector = "css=#ajax select[name='severity_0']"
-        def durationSelector = "css=#ajax select[name='duration_0']"
-        def messageSelector = "css=#ajax input[name='message_0']"
-        def markupSelector = "css=#ajax input[name='markup_0']"
+        def severitySelector = "css=#ajax select[name='select_0']"
+        def durationSelector = "css=#ajax select[name='select_1']"
+        def messageSelector = "css=#ajax input[name='textField']"
+        def markupSelector = "css=#ajax input[name='checkboxField']"
 
         select severitySelector, "Error"
         select durationSelector, "Until Dismissed"

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/22bd2c14/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ZoneFormDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ZoneFormDemo.tml
b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ZoneFormDemo.tml
index 203ca8b..373c166 100644
--- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ZoneFormDemo.tml
+++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ZoneFormDemo.tml
@@ -2,7 +2,7 @@
 
     <h1>Zone Form Demo</h1>
 
-    <t:zone t:id="zone" simpleids="true">
+    <t:zone t:id="zone">
 
         <t:form zone="^" t:id="form">
 


Mime
View raw message