I suspect Tapestry is not recognizing that
SubClass.onSuccessFromStep1() is an override of
BaseClass.onSuccessFromStep1() (perhaps the abstract flag is throwing
it).

So, Tapestry builds code for BaseClass, and implements
dispatchComponentEvent() to invoke onSuccessFromStep1().

It then builds code for SubClass, sees onSuccessFromStep1(), doesn't
think it's an override of the base class method (for whatever reason),
and implements dispatchComponentEvent() to (a) invoke
super.dispatchComponentEvent(), and (b) invoke onSuccessFromStep1().
Thus two invocations.

Probably a bug, but may only be fixed in 5.4 or 5.3.1 at this point.


On Thu, Oct 27, 2011 at 3:26 AM, Peter Stavrinides
<p.stavrini...@albourne.com> wrote:
> FYI: returning true will also work, so I am happy to use that as a workaround 
> instead, but I am still puzzled as to why it gets invoked twice? I suspect 
> this is going to cause issues when I need to return an Object.
>
> cheers,
> Peter
>
> ----- Original Message -----
> From: "Peter Stavrinides" <p.stavrini...@albourne.com>
> To: "Tapestry Mailing List" <users@tapestry.apache.org>
> Sent: Thursday, 27 October, 2011 13:11:35 GMT +02:00 Athens, Bucharest, 
> Istanbul
> Subject: Possible regression Tapestry 5.1 to 5.3
>
> Hi all,
>
> We noticed some odd behaviour today in one of our apps, it appears when we 
> use the pattern detailed below, the onSuccessFromStep1() event gets invoked 
> twice by Tapestry, this was not the case in 5.1:
>
> public abstract class BaseClass {
>   public abstract Object onSuccessFromStep1();
> }
>
>
> public class SubClass extends BaseClass{
>
> @Override
> public Object onSuccessFromStep1() {
>   if (!foundErrors())
>        incrementStep();
>   return null;
> }
>
> }
>
> Of course a simple workaround is to remove the @Override, but that really 
> defeats the purpose of using a base class.
>
> regards,
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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

Reply via email to