And from within the component itself you can override onEvent and handle the event whose payload is an AjaxRequestTarget. The component can then check if it's in the getComponents() collection of said target.

e.g.

@Override
    public void onEvent( IEvent< ? > event )
    {
        Object payload = event.getPayload();

        if( payload instanceof AjaxRequestTarget )
        {
            AjaxRequestTarget target = (AjaxRequestTarget) payload;
            if(target.getComponents().contains(this)) {
                 // your logic goes here
            }
        }
    }

Met vriendelijke groet,
Kind regards,

Bas Gooren

schreef Martin Grigorov op 4-11-2013 8:27:
Hi,

You can use
org.apache.wicket.ajax.AjaxRequestTarget.IListener#onBeforeRespond(Map<String,
Component> map, AjaxRequestTarget) to be notified before ART starts
preparing its XML response.
The 'map' contains all already added components.



On Fri, Nov 1, 2013 at 3:45 PM, Nick Pratt <nbpr...@gmail.com> wrote:

Is there a way for a Component to detect if its been added to an
AjaxRequestTarget?

N


Reply via email to