Thanks Mark - an interesting solution! I'll see if I can adapt it for my
needs.

-----Original Message-----
From: Mark Stang [mailto:[EMAIL PROTECTED] 
Sent: 07 September 2005 18:20
To: Tapestry users; Tapestry users
Subject: RE: Form listener control

In Tapestry 3, I have been doing something similar.

I use the following tags:

   selected="ognl:submitListener" tag="ognl:listeners.onFinish"

which is part of:

     <input jwcid="@Submit"
label="ognl:page.visit.currentTasklet.finishLabel"
selected="ognl:submitListener" tag="ognl:listeners.onFinish"/>          

This is at the page level.  When the submit button is called, the
formListener is called and the abstract variable submitListener has been
populated with the listener "onFinish".

    private IActionListener submitListener;


In my components I do:

     <input type="submit" name="button" jwcid="@Submit"
selected="ognl:submitListener" tag="ognl:listeners.create"
value="Create"/>

and I specify  

    private IActionListener submitListener;

So, when a button is pressed, either at the page or the component level
only one of these will be non-null.  
What this means is that only one listener can be non-null so you can use
that as a flag for executing the rest of the formListener or not.

HTH,

Mark


-----Original Message-----
From: Geoff Longman [mailto:[EMAIL PROTECTED]
Sent: Wed 9/7/2005 6:09 AM
To: Tapestry users
Subject: Re: Form listener control
 
Tapestry 3, no
Tapestry 4, I'm not sure.

Geoff

On 9/7/05, Joe Trewin <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a form with a listener, and a submit component with it's own 
> listener.
> 
> Is there a way for the submit listener to prevent the form listener 
> from being executed? I'm thinking specifically of how desktop event 
> systems are usually implemented, so that event listeners can choose to

> pass events further up the chain, or handle them themselves and 
> prevent further processing.
> 
> My reason for doing this is that I may have a custom component in a 
> form that has it's own submit button that needs to do something 
> different with the form data to whatever the form does.
> 
> Cheers,
> Joe
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
The Spindle guy.           http://spindle.sf.net
Get help with Spindle:   
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:    
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates:            http://spindle.sf.net/updates

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to