Consequences of sharing ajax request target by attribute or by static determination

2009-09-30 Thread Per Newgro

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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Consequences of sharing ajax request target by attribute or by static determination

2009-09-30 Thread Pedro Santos
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 per.new...@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-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos