You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Per Newgro <pe...@gmx.ch> on 2009/09/30 09:38:01 UTC
Consequences of sharing ajax request target by attribute or by static
determination
Hi *,
i would like to know if there "hidden" consequences if i exchange
sharing by attribute through sharing by static determination.
To couple my event-components with it's higher ranking components i use
a listener based approach. Each parent adds a
listener to the child can be involved if an event occurs.
The problem is that i sometimes use ajax event components and sometimes
not. Thus until now i have to provide two different
event classes. The one for ajax usage contains an attribute with the
current ajax request target. The event sources creates the
event and provides the request target.
But now if found AjaxRequestTarget.get. Javadoc says "Static method that
returns current |AjaxRequestTarget|
<http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html>
or |null| of no |AjaxRequestTarget|
<http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html>
is available."
So this exactly what i tried to achieve with the two event types.
So my question is: Can i simplify my event objects by throwing the
request target attribute away and use the AjaxRequestTarget.get method
in my listener chain?
Or why is this not a good idea?
Thanks for clearing it to me.
Cheers
Per
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Consequences of sharing ajax request target by attribute or by
static determination
Posted by Pedro Santos <pe...@gmail.com>.
I think ajax fallback strategy is a good idea:
class AjaxFallbackEvent{
void handleSomething( target){
// user implementations test for target == null
}
}
On Wed, Sep 30, 2009 at 4:38 AM, Per Newgro <pe...@gmx.ch> wrote:
> Hi *,
>
> i would like to know if there "hidden" consequences if i exchange sharing
> by attribute through sharing by static determination.
> To couple my event-components with it's higher ranking components i use a
> listener based approach. Each parent adds a
> listener to the child can be involved if an event occurs.
>
> The problem is that i sometimes use ajax event components and sometimes
> not. Thus until now i have to provide two different
> event classes. The one for ajax usage contains an attribute with the
> current ajax request target. The event sources creates the
> event and provides the request target.
>
> But now if found AjaxRequestTarget.get. Javadoc says "Static method that
> returns current |AjaxRequestTarget| <
> http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html>
> or |null| of no |AjaxRequestTarget| <
> http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/AjaxRequestTarget.html>
> is available."
> So this exactly what i tried to achieve with the two event types.
>
> So my question is: Can i simplify my event objects by throwing the request
> target attribute away and use the AjaxRequestTarget.get method in my
> listener chain?
> Or why is this not a good idea?
>
> Thanks for clearing it to me.
> Cheers
> Per
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Pedro Henrique Oliveira dos Santos