if(!task().isDone()) { String modifiedDynamicUrl = aContext.urlWithRequestHandlerKey(WOApplication.application().componentRequestHandlerKey(), null, null);  String header = "" +refreshInterval()+ ";url=" +modifiedDynamicUrl+ "/" + aContext.session().sessionID()+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;  aResponse.setHeader(header, "Refresh"); } else if(task().isDone() && !_doneAndRefreshed) {
if(!done || (doneButNotRefreshed)) {
    public void appendToResponse(WOResponse aResponse, WOContext aContext)  {        if (!_performingAction) {            _performingAction = true;            task().setLongResponse(this);            task().start();        }        // If the refreshInterval was set and we did not get a result yet, let's add the refresh header.        if(!task().isDone()) {            String modifiedDynamicUrl = aContext.urlWithRequestHandlerKey(WOApplication.application().componentRequestHandlerKey(), null, null);            String header = "" +refreshInterval()+ ";url=" +modifiedDynamicUrl+ "/" + aContext.session().sessionID()+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;            aResponse.setHeader(header, "Refresh");        } else if(task().isDone() && !_doneAndRefreshed) {            // If the response is done and finished quickly (before the first branch of this conditional is invoked),            // make sure to refresh the page immediately.            String modifiedDynamicUrl = aContext.urlWithRequestHandlerKey(WOApplication.application().componentRequestHandlerKey(), null, null);            String header = "0;url=" +modifiedDynamicUrl+ "/" + aContext.session().sessionID()+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;            aResponse.setHeader(header, "Refresh");            _doneAndRefreshed = true;        }        super.appendToResponse(aResponse, aContext);    }