You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Peter Rietzler (JIRA)" <ji...@apache.org> on 2009/12/01 14:08:20 UTC

[jira] Updated: (TAP5-930) linksubmit does not fire sumbit event in 5.1.0.5

     [ https://issues.apache.org/jira/browse/TAP5-930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Rietzler updated TAP5-930:
--------------------------------

    Attachment: linksubmit.js

We've got the same problem. 

The problem is that form.submit() does not execute event handlers attached to the form element.

The submitted patch solves this issue for Firefox only! I've tried to do the same with prototype's Event.fire() method but there was no chance to react on the return value of the event handler functions (maybe there is but I haven't inspected this in detail...)

If you wonder about the removeHidden() function ... I had the problem that the hidden field is NOT transmitted if it's added after the event was raised.

This is just a quick fix - but I guess it should show the basic problem.

Cheers,
Peter

> linksubmit does not fire sumbit event in 5.1.0.5
> ------------------------------------------------
>
>                 Key: TAP5-930
>                 URL: https://issues.apache.org/jira/browse/TAP5-930
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.1
>         Environment: java 1.6
> windows 7
> tapestry 5.1.0.5
> firefox 3.5 or google chrome
>            Reporter: Sergey Kashin
>            Priority: Critical
>         Attachments: linksubmit.js
>
>
> linksubmit does not fire sumbit form
> where is no any action
> if i change linksubmit to submit buttom all works fine
> Template:
> ----------------------------------------------------------------------------------
> <?xml version="1.0" encoding="windows-1251"?>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"  xmlns:p="tapestry:parameter">
>     <t:form t:id="frm" >
>        <t:textfield value="txt"></t:textfield><br/>
>       <t:linksubmit t:id="save" >Save</t:linksubmit> .  <t:linksubmit t:id="cancel" >Cancel</t:linksubmit>
>     </t:form>
> </html>
> ----------------------------------------------------------------------------------
> java code:
> ----------------------------------------------------------------------------------
>   private Object formEventReturn;
>   @Property
>   private String txt;
>   void onSelectedFromSave() {
>     // do whatever;
>     formEventReturn = Index.class; // go to AnotherPage
>   }
>   void onSelectedFromCancel() {
>     // do whatever
>     formEventReturn = null; // stay on this page
>   }
> Object onSuccessFromFrm() {
>   //do things specific to form Foo
>   return formEventReturn;
> }
> ----------------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.