Taken from http://tapestry.apache.org/tapestry5.1/guide/event.html and should 
answer your question I think.


Multiple Method Matches

In some cases, you may have multiple event methods match a single event.

The order is as follows:

    * Base class methods before sub-class methods.
    * Matching methods within a class in alphabetical order.
    * For a single method name with multiple overrides, by number of 
parameters, descending.

There's only rare cases where it makes sense for more than one method to handle 
an event.

When a sub-class overrides an event handler method of a base class, the event 
handler method is only invoked once, along with any other base class methods. 
The subclass can change the implementation of the base class method via an 
override, but can't change the timing of when that method is invoked. See 
TAPESTRY-2311.


> -----Original Message-----
> From: Peter Kanze [mailto:peterka...@gmail.com]
> Sent: 25 March 2009 11:11
> To: Tapestry users
> Subject: T5: onActivate called twice
> 
> Hello
> I have a pagelink that point to this /products/computer/5
> 
> In my Products.java I have two onActivate methods. See below.
> When I click the pageLink I can see that both onActivate are called.
> Because this is printed to the output console:
> 
> onActivate(String categoryName, int pageNr)
> onActivate: (String categoryName)
> 
> Can somebody explain this?
> I would expect only public void onActivate(String categoryName, int
> pageNr)
> to be called, because the context has 2 parameters.
> 
> greetz,
> Peter
> 
> 
> public void onActivate(String categoryName) {
> System.out.println("onActivate: (String categoryName)");
> }
> public void onActivate(String categoryName, int pageNr) {
> System.out.println("onActivate(String categoryName, int pageNr)");
> }


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to