[ https://issues.apache.org/jira/browse/TAPESTRY-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Andreou resolved TAPESTRY-1673. --------------------------------------- Resolution: Won't Fix Alejandro, no! What you're seeing is TAPESTRY-2225 :( as for "submitType=cancel killing its listener", it happens because there's no rewind taking place in that case. > Why does submitType="cancel" kill its listener? > ----------------------------------------------- > > Key: TAPESTRY-1673 > URL: https://issues.apache.org/jira/browse/TAPESTRY-1673 > Project: Tapestry > Issue Type: Bug > Components: Core Components > Affects Versions: 4.1.2 > Environment: Tap 4.1.2, Firefox 2.0.0.5 or IE 7 on Win XP SP2, Safari 2.0.4 or Firefox 2.0.0.5 on OS X 10.4.10, served by Tomcat in JBoss 4.2.1. > Reporter: Geoff Callender > Assignee: Andreas Andreou > Priority: Critical > Fix For: 4.1.6 > > Attachments: CancelPage screenshot.jpg > > > Is there a reason why submitType kills its component's listener? For example, whereas this listener works... > > ... the listener in this one is ignored... > > ...and the listener has to be specified on the Form instead... >
> Why is this so? What if I want more than one button of type cancel, each one with its own listener, and possibly its own parameters? I think submitType="refresh" behaves this way, too. > Here's a working example: > package sandpit; > import org.apache.tapestry.html.BasePage; > public abstract class CancelPage extends BasePage { > public abstract void setMessage1(String value); > public abstract void setMessage2(String value); > public void doComponentListener() { > setMessage1("doComponentListener() invoked."); > } > public void doFormListener() { > setMessage2("doFormListener() invoked."); > } > } > > >

Demonstration of how submitType="cancel" kills the component's listener

> > >
> This form does NOT specify a cancel listener > > Whereas this listener works...
> GOOD
> <input jwcid="@Submit" type="submit" value="Submit" action="listener:doComponentListener"/>

> > ... the listener in this one is ignored, which is bad...
> BAD
> <input jwcid="@Submit" type="submit" value="Cancel" submitType="cancel" action="listener:doComponentListener"/>

>
>
>
>
> This form specifies cancel="listener:doFormListener" > > Whereas this listener works...
> GOOD
> <input jwcid="@Submit" type="submit" value="Submit" action="listener:doComponentListener"/>

> > ... the listener in this one is ignored, and the form's listener takes over, which is questionable...
> QUESTIONABLE
> <input jwcid="@Submit" type="submit" value="Cancel" submitType="cancel" action="listener:doComponentListener"/>

> > ...but in this case the form's listener works...
> GOOD
> <input jwcid="@Submit" type="submit" value="Cancel" submitType="cancel"/>

>
>
> Message1: Message
> Message2: Message > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org For additional commands, e-mail: dev-help@tapestry.apache.org