You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Lenny Primak (Commented) (JIRA)" <ji...@apache.org> on 2011/10/26 22:49:32 UTC

[jira] [Commented] (TAP5-1730) Ajax Zone is improperly reloaded when a mixin submits form via JavaScript

    [ https://issues.apache.org/jira/browse/TAP5-1730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136352#comment-13136352 ] 

Lenny Primak commented on TAP5-1730:
------------------------------------

I think there should be performSubmit() or similar function that takes the submitting element
and calls setSubmittingElement() so there is a standard way for JavaScript to invoke forms in a zone,
and it should be documented somewhere as well.
                
> Ajax Zone is improperly reloaded when a mixin submits form via JavaScript
> -------------------------------------------------------------------------
>
>                 Key: TAP5-1730
>                 URL: https://issues.apache.org/jira/browse/TAP5-1730
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.3, 5.4
>            Reporter: Lenny Primak
>            Priority: Minor
>
> Tapestry reloads the zone improperly if JS code 
> Improperly submits the form.  It should at least give some kind of an error
> or a warning when happens.
> Right now, it fails silently leading to an improper zone reload,
> which leads to weird errors when app is running subsequently.
> If form..setSubmittingElement(() isn't called before form.onsubmit(),
> the Tapestry silently fails and the zone is improperly reloaded.
> ---------------------------------------------------------------
> There was an addition of one line:
> $(this.formId).setSubmittingElement($(this.elementId)); // *** ADDED otherwise zone gets improperly reloaded
>  $(this.formId).onsubmit();  // Submit Ajax form
> If you don't add the first line, the form is reloaded improperly after the zone update,
> so it doesn't work the second time.
> This is not documented anywhere, and really hard to debug.
> See threads:
> http://mail-archives.apache.org/mod_mbox/tapestry-users/201110.mbox/%3C21CB9971-ED77-4F37-9C72-501D0F5137B5@hope.nyc.ny.us%3E
> http://tapestry.1045711.n5.nabble.com/Mixins-stop-working-after-a-zone-update-please-help-td4935912.html

--
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