>From memory (not sure, I read that while looking for something else), any Ajax 
>request generate automatically an IEvent event that is broadcasted to the 
>application. If so, you could override the onEvent(IEvent<?> event) method of 
>your FeedbackPanel so that it adds itself to the target of all Ajax event that 
>are triggered:

@Override
public void onEvent(IEvent<?> event) {
    if (event.getPayload() instanceof AjaxRequestTarget) {
        ((AjaxRequestTarget)event.getPayload()).add(this);
    }
}

With this your custom FeedbackPanel, it will add itself to the 
AjaxRequestTarget automatically.

Hope this helps and I remembered correctly ;)

On 07/18/2012 09:17 PM, LeaveNewb wrote:
> wheleph wrote
>> Hello everyone!
>>
>> My application has a lot of ajax components. And every time validation
>> error occurs I need to add my FeedbackPanel to AjaxRequestTarget. Is there
>> a way to do it automatically? I mean to add my FeedbackPanel to every ajax
>> response 
>>
>> wheleph
>>
> We accomplished this in our Wicket 1.4 application by overriding
> newAjaxRequestTarget() in our WebApplication class, like this:
>
>
>       @Override
>       public AjaxRequestTarget newAjaxRequestTarget( Page page )
>       {
>               AjaxRequestTarget t = super.newAjaxRequestTarget( page );
>               if( t!=null )
>                       t.addComponent( getFeedbackPanel() );
>
>               return t;
>       }
>
> Unfortunately in 1.5 this function is *final*, so it can't be overwritten. 
> So I'm looking for a way to do this as well.  Did you every get this
> working?
>
> Can anyone point me in the right direction?
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Intercept-AjaxRequestTarget-tp1850904p4650605.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


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

Reply via email to