You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andreas Andreou <an...@gmail.com> on 2008/02/07 15:52:13 UTC
[T4] EventListener and invocation of related method
This issue is quite similar to the listener and action parameters of
submit components [1].
Currently, the method annotated with EventListener is invoked after
all the elements of the
form are rewound (like the action parameter does).
I've just come across a situation that i would like
to have (either the same or another) method called as soon as the
component that triggered the
submission is rewound (like the listener parameter does).
To give an example (quite similar to [2]), here's a simple Selector
component (wrapper for PropertySelection)
@EventListener(targets="data", events="onchange")
public void doSelect() { System.out.println("Selected: " + getValue()); }
When used in the following manner:
<form jwcid="@Form">
<span jwcid="@For" source="ognl:{1,2,3}">
<span jwcid="@Selector"/>
</span>
</form>
it'll always display the value of the last select
So, my questions are:
-) Does it makes sense to add a "listener" parameter to @EventListener
that'll be called at the 'correct' time?
-) Any workarounds or alternatives?
[1] http://tapestry.apache.org/tapestry4.1/components/form/submit.html
[2] https://issues.apache.org/jira/browse/TAPESTRY-2092
--
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T4] EventListener and invocation of related method
Posted by Igor Drobiazko <ig...@gmail.com>.
Well, I'm not sure but if you can't get the correct value, it looks like a
bug to me.
On Feb 7, 2008 3:52 PM, Andreas Andreou <an...@gmail.com> wrote:
> This issue is quite similar to the listener and action parameters of
> submit components [1].
>
> Currently, the method annotated with EventListener is invoked after
> all the elements of the
> form are rewound (like the action parameter does).
>
> I've just come across a situation that i would like
> to have (either the same or another) method called as soon as the
> component that triggered the
> submission is rewound (like the listener parameter does).
>
> To give an example (quite similar to [2]), here's a simple Selector
> component (wrapper for PropertySelection)
>
> @EventListener(targets="data", events="onchange")
> public void doSelect() { System.out.println("Selected: " + getValue());
> }
>
> When used in the following manner:
>
> <form jwcid="@Form">
> <span jwcid="@For" source="ognl:{1,2,3}">
> <span jwcid="@Selector"/>
> </span>
> </form>
>
> it'll always display the value of the last select
>
> So, my questions are:
> -) Does it makes sense to add a "listener" parameter to @EventListener
> that'll be called at the 'correct' time?
> -) Any workarounds or alternatives?
>
>
> [1] http://tapestry.apache.org/tapestry4.1/components/form/submit.html
> [2] https://issues.apache.org/jira/browse/TAPESTRY-2092
>
> --
> Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Best regards,
Igor Drobiazko