Thank you all. I am then going to use a private method invoked by both
public methods.
Regards,
Julien.

2011/8/3 Howard Lewis Ship <hls...@gmail.com>

> -1
>
> Thiago had the right solution.  Further, the second event
> ("fromMyAjaxEvent") will occur after the "activate" event itself
> (assuming that the Ajax-request originating component is on the same
> page).
>
> It is very much an exception to the rule to have multiple events
> handled by the same method. It is occasionally useful to have a single
> method handle events from multiple component ids (by exploding the
> "from" portion of the method name).
>
> On Tue, Aug 2, 2011 at 4:03 PM, Taha Hafeez <tawus.tapes...@gmail.com>
> wrote:
> > How about having a new annotation ??
> >
> > @OnEvents(
> >   {
> >      @OnEvent(...), @OnEvent(...)
> >   })
> >
> >
> > On Wed, Aug 3, 2011 at 4:22 AM, nillehammer
> > <tapestry.nilleham...@winfonet.eu> wrote:
> >> You could implement one method that is called by your two event
> handlers.
> >> E.g.
> >>
> >> @OnEvent(EventConstants.ACTIVATE)
> >> final void callEventHandlerFromActivate() {
> >>  this.doTheWork();
> >> }
> >>
> >> @OnEvent("yourAjaxEvent")
> >> final void callEventHandlerFromMyAjaxEvent() {
> >>  this.doTheWork();
> >> }
> >>
> >> private final void doTheWork() {
> >> ...
> >> }
> >>
> >>
> >> -----
> >> http://www.winfonet.eu
> >> --
> >> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Specifying-several-event-constants-for-the-OnEvent-annotation-tp4659025p4660584.html
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
> >
> >
> > --
> >
> > regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > ---------------------------------------------------------------------
> > 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