/** * Builds and processes a request suitable for executing an <code>AbstractAjaxBehavior</code>. * * @param behavior * an <code>AbstractAjaxBehavior</code> to execute */ public void executeBehavior(final AbstractAjaxBehavior behavior) { CharSequence url = behavior.getCallbackUrl(false); WebRequestCycle cycle = setupRequestAndResponse(true); getServletRequest().setRequestToRedirectString(url.toString()); processRequestCycle(cycle); }
/** * Builds and processes a request suitable for executing an <code>AbstractAjaxBehavior</code>. * * @param behavior * an <code>AbstractAjaxBehavior</code> to execute */ public void executeBehavior(final AbstractAjaxBehavior behavior) { // setupRequestAndResponse(); WebRequestCycle cycle = createRequestCycle(); CharSequence url = behavior.getCallbackUrl(false); setupRequestAndResponse(true); cycle = createRequestCycle(); getServletRequest().setRequestToRedirectString(url.toString()); processRequestCycle(cycle); }
protected void waitOnImportProgressPage() { do { // manually run the ajax timer behavior attached to the "info" markup container try { List<IBehavior> behaviors = tester.getComponentFromLastRenderedPage("info").getBehaviors(); for (IBehavior behavior: behaviors) { if(behavior instanceof AbstractAjaxTimerBehavior) { AbstractAjaxTimerBehavior tb = (AbstractAjaxTimerBehavior) behavior; CharSequence url = tb.getCallbackUrl(false); WebRequestCycle cycle = tester.setupRequestAndResponse(true); tester.getServletRequest().setRequestToRedirectString(url.toString()); tester.processRequestCycle(cycle); } } } catch(WicketRuntimeException e) { // this happens a lot if the page switched while we where looping } } while(tester.getLastRenderedPage().getClass().equals(ImportProgressPage.class)); }
String redirectLocation = httpResponse.getRedirectLocation(); cycle = setupRequestAndResponse(false); servletRequest.setRequestToRedirectString(redirectLocation); cycle.request(); newHttpRequest.setRequestToRedirectString(url); wicketRequest = application.newWebRequest(newHttpRequest);
newHttpRequest.setRequestToRedirectString(httpResponse.getRedirectLocation()); wicketRequest = application.newWebRequest(newHttpRequest);