AjaxLink<?> link = (AjaxLink<?>)linkComponent;
setupRequestAndResponse(true);
WebRequestCycle requestCycle = createRequestCycle();
callOnBeginRequest(requestCycle);
AjaxRequestTarget target = new AjaxRequestTarget(link.getPage());
requestCycle.setRequestTarget(target);
link.onClick(target);
// process the request target
processRequestCycle(requestCycle);
}
// AjaxFallbackLinks is processed like an AjaxLink if isAjax is true
// If it's not handling of the linkComponent is passed through to the
// Link.
else if (linkComponent instanceof AjaxFallbackLink && isAjax)
{
AjaxFallbackLink<?> link = (AjaxFallbackLink<?>)linkComponent;
setupRequestAndResponse(true);
WebRequestCycle requestCycle = createRequestCycle();
AjaxRequestTarget target = new AjaxRequestTarget(link.getPage());
requestCycle.setRequestTarget(target);
link.onClick(target);
// process the request target