tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject [1/6] git commit: Remove the events.form.processSubmission event as it is not needed
Date Mon, 22 Oct 2012 23:21:20 GMT
Updated Branches:
  refs/heads/5.4-js-rewrite 6d6c1eb7c -> c7596e911


Remove the events.form.processSubmission event as it is not needed


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

Branch: refs/heads/5.4-js-rewrite
Commit: c7596e9115d40968d54e2a8c370f9d62c29dfd73
Parents: 18fb8a0
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Mon Oct 22 16:20:54 2012 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Mon Oct 22 16:20:54 2012 -0700

----------------------------------------------------------------------
 .../META-INF/modules/core/events.coffee            |    8 --------
 .../META-INF/modules/core/forms.coffee             |   13 ++-----------
 .../resources/org/apache/tapestry5/tapestry.js     |    5 ++---
 3 files changed, 4 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c7596e91/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee
index e920006..2a4b045 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/events.coffee
@@ -31,14 +31,6 @@ define
     # The `core/spi.EventWrapper` for the form element is passed as the memo.
     prepareForSubmit: "t5:form:prepare-for-submit"
 
-    # Triggered last, when the form is configured to not submit normally (as a standard POST).
Under 5.3, this
-    # configuration was achieved by adding the `t-prevent-submission` CSS class; under 5.4
it is preferred to
-    # set the `data-prevent-submission` attribute. In either case, the submit event is stopped,
and this
-    # event fired to replace it; in most cases, a handler will then handle submitting the
form's data as part
-    # of an Ajax request.
-    # The `core/spi.EventWrapper` for the form element is passed as the memo.
-    processSubmit: "t5:form:process-submit"
-
   field:
     # Triggered by the Form on all enclosed elements with the `data-validation` attribute
(indicating they are
     # interested in participating with user input validation). The memo object passed to
the event has an error property

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c7596e91/tapestry-core/src/main/coffeescript/META-INF/modules/core/forms.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/forms.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/forms.coffee
index 57a8fbd..effe4f2 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/forms.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/forms.coffee
@@ -23,9 +23,6 @@ define ["core/events", "core/spi", "core/builder", "_"],
     # the form was submitted by a "cancel" button).
     SKIP_VALIDATION = "t5:skip-validation"
 
-    isPreventSubmission = (element) ->
-      element.attribute "data-prevent-submission"
-
     clearSubmittingHidden = (form) ->
       hidden = form.findFirst "[name='t:submit']"
 
@@ -115,16 +112,10 @@ define ["core/events", "core/spi", "core/builder", "_"],
       # is no memo.
       this.trigger events.form.prepareForSubmit, this
 
-      # Sometimes we want to submit the form normally, for a full-page render.
-      # Othertimes we want to stop here and let the `events.form.processSubmit`
-      # handler take it from here.
-      # TODO: Prevent Submission may not be necessary, as we can simply handle the submit
-      # at a higher level. This may be Tapestry 5.3 thinking.
-      if isPreventSubmission this
-        this.trigger events.form.processSubmit, this
-        return false
 
       # Otherwise, the event is good, there are no validation problems, let the normal processing
commence.
+      # Possibly, the document event handler in core/zone will intercept form submission
if this
+      # is an Ajax submission.
       return
 
     # TODO: May want to define a data attribute to control whether Tapestry gets

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c7596e91/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js b/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
index ac8beb8..54a21f4 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js
@@ -103,11 +103,10 @@ define("core/compat/tapestry", [
         CONSOLE_DURATION: 10,
 
         /**
-         * CSS Class added to a &lt;form&gt; element that directs Tapestry to
+         * CSS Class added to a &lt;form&gt; element that directs Tapestry 5.3 to
          * prevent normal (HTTP POST) form submission, in favor of Ajax
-         * (XmlHttpRequest) submission.    It will be removed in Tapestry 5.5.
+         * (XmlHttpRequest) submission. It is ignored under 5.4.
          *
-         * @deprecated Use data-prevent-submission="true" instead
          */
         PREVENT_SUBMISSION: "t-prevent-submission",
 


Mime
View raw message