You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Paul Stanton (Created) (JIRA)" <ji...@apache.org> on 2012/02/28 05:56:48 UTC
[jira] [Created] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Tapestry attempts to link to non-tapestry forms
-----------------------------------------------
Key: TAP5-1859
URL: https://issues.apache.org/jira/browse/TAP5-1859
Project: Tapestry 5
Issue Type: Bug
Components: tapestry-core
Affects Versions: 5.3.2
Reporter: Paul Stanton
When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
TML test case:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
<t:zone t:id="dum" /><!-- make sure js is loaded into page -->
<head></head>
<body>
<form>
<input type="submit" />
</form>
</body>
</html>
Excerpt from tapestry.js:
getFormEventManager : function(form) {
form = $(form);
var manager = $T(form).formEventManager;
if (manager == undefined) {
throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
.interpolate(form);
}
return manager;
},
is called by:
setSubmittingElement : function(form, element) {
form.getFormEventManager()
.setSubmittingElement(element);
},
is called by:
/*
* When a submit element is clicked, record the name of the element into
* the associated form. This is necessary for some Ajax processing, see
* TAPESTRY-2324.
*
* TAP5-1418: Added "type=image" so that they set the submitting element
* correctly.
*/
$$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
var t = $T(element);
if (!t.trackingClicks) {
element.observe("click", function() {
$(element.form).setSubmittingElement(element);
});
t.trackingClicks = true;
}
});
The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
// skip if this is not a tapestry controlled form
if (this.form.getInputs("hidden", "t:formdata").size() == 0)
return;
The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (TAP5-1859) Clicking a submit or button in a
non-Tapestry Form causes a client exception
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAP5-1859.
--------------------------------------
Resolution: Fixed
Fix Version/s: 5.3.5
Based on the work that's already gone on in 5.4, I don't think this bug affects that code anymore; for example, there is no FormEventManager anymore.
> Clicking a submit or button in a non-Tapestry Form causes a client exception
> ----------------------------------------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
> Fix For: 5.3.5
>
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAP5-1859:
------------------------------------------
Assignee: Howard M. Lewis Ship
> Tapestry attempts to link to non-tapestry forms
> -----------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TAP5-1859) Clicking a submit or button in a
non-Tapestry Form causes a client exception
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship updated TAP5-1859:
---------------------------------------
Summary: Clicking a submit or button in a non-Tapestry Form causes a client exception (was: Tapestry attempts to link to non-tapestry forms)
> Clicking a submit or button in a non-Tapestry Form causes a client exception
> ----------------------------------------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
> Fix For: 5.3.5
>
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TAP5-1859) Clicking a submit or button in a
non-Tapestry Form causes a client exception
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship updated TAP5-1859:
---------------------------------------
Summary: Clicking a submit or button in a non-Tapestry Form causes a client exception (was: Tapestry attempts to link to non-tapestry forms)
> Clicking a submit or button in a non-Tapestry Form causes a client exception
> ----------------------------------------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
> Fix For: 5.3.5
>
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437190#comment-13437190 ]
Howard M. Lewis Ship commented on TAP5-1859:
--------------------------------------------
Why ever would you have forms that aren't Tapestry forms? :-)
> Tapestry attempts to link to non-tapestry forms
> -----------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Posted by "Paul Stanton (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217910#comment-13217910 ]
Paul Stanton commented on TAP5-1859:
------------------------------------
Here's a workaround - to avoid tapestry adding its click listener to the submit, set the flag before tapestry has a chance (before onDomLoaded)
<form>
<input type="submit" id="theSubmit" />
</form>
<script type="text/javascript">
var t = $T("theSubmit");
t.trackingClicks = true;
</script>
> Tapestry attempts to link to non-tapestry forms
> -----------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Labels: FormEventManager, form
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Posted by "Paul Stanton (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13217910#comment-13217910 ]
Paul Stanton commented on TAP5-1859:
------------------------------------
Here's a workaround - to avoid tapestry adding its click listener to the submit, set the flag before tapestry has a chance (before onDomLoaded)
<form>
<input type="submit" id="theSubmit" />
</form>
<script type="text/javascript">
var t = $T("theSubmit");
t.trackingClicks = true;
</script>
> Tapestry attempts to link to non-tapestry forms
> -----------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Labels: FormEventManager, form
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437190#comment-13437190 ]
Howard M. Lewis Ship commented on TAP5-1859:
--------------------------------------------
Why ever would you have forms that aren't Tapestry forms? :-)
> Tapestry attempts to link to non-tapestry forms
> -----------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (TAP5-1859) Clicking a submit or button in a
non-Tapestry Form causes a client exception
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship closed TAP5-1859.
--------------------------------------
Resolution: Fixed
Fix Version/s: 5.3.5
Based on the work that's already gone on in 5.4, I don't think this bug affects that code anymore; for example, there is no FormEventManager anymore.
> Clicking a submit or button in a non-Tapestry Form causes a client exception
> ----------------------------------------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
> Fix For: 5.3.5
>
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (TAP5-1859) Tapestry attempts to link to
non-tapestry forms
Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-1859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Howard M. Lewis Ship reassigned TAP5-1859:
------------------------------------------
Assignee: Howard M. Lewis Ship
> Tapestry attempts to link to non-tapestry forms
> -----------------------------------------------
>
> Key: TAP5-1859
> URL: https://issues.apache.org/jira/browse/TAP5-1859
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.3.2
> Reporter: Paul Stanton
> Assignee: Howard M. Lewis Ship
> Labels: FormEventManager, form, submit
>
> When submitting a html form which was not constructed using the tapestry Form component, tapestry.js still attempts to acquire a Tapestry.FormEventManager, resulting in an uncaught JS exception.
> TML test case:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
> <t:zone t:id="dum" /><!-- make sure js is loaded into page -->
> <head></head>
> <body>
> <form>
> <input type="submit" />
> </form>
> </body>
> </html>
> Excerpt from tapestry.js:
> getFormEventManager : function(form) {
> form = $(form);
> var manager = $T(form).formEventManager;
> if (manager == undefined) {
> throw "No Tapestry.FormEventManager object has been created for form '#{id}'."
> .interpolate(form);
> }
> return manager;
> },
> is called by:
> setSubmittingElement : function(form, element) {
> form.getFormEventManager()
> .setSubmittingElement(element);
> },
> is called by:
> /*
> * When a submit element is clicked, record the name of the element into
> * the associated form. This is necessary for some Ajax processing, see
> * TAPESTRY-2324.
> *
> * TAP5-1418: Added "type=image" so that they set the submitting element
> * correctly.
> */
> $$("INPUT[type=submit]", "INPUT[type=image]").each(function(element) {
> var t = $T(element);
> if (!t.trackingClicks) {
> element.observe("click", function() {
> $(element.form).setSubmittingElement(element);
> });
> t.trackingClicks = true;
> }
> });
> The solution is probably to add a check within this last snippet to make sure you are dealing with a tapestry form:
> // skip if this is not a tapestry controlled form
> if (this.form.getInputs("hidden", "t:formdata").size() == 0)
> return;
> The above is taken from elsewhere in tapestry.js.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira