// Hacky URLs that are might not work in all deployment scenarios
@Override
    protected void setup(VaadinRequest request) {
        addComponent(new ProgressIndicator() {
            {
                registerRpc(new ProgressIndicatorServerRpc() {
                    @Override
                    public void poll() {
                        // System.out.println("Pausing poll request");
                        try {
                            // Make the XHR request last longer to make it
                            // easier to click the link at the right moment.
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                        // System.out.println("Continuing poll request");
                    }
                });
                setPollingInterval(3000);
            }
        });
        // Hacky URLs that are might not work in all deployment scenarios
        addComponent(new Link("Navigate away", new ExternalResource(
                "slowRequestHandler")));
        addComponent(new Link("Start download", new ExternalResource(
                "slowRequestHandler?download")));
    }
}
});
// Hacky URLs that are might not work in all deployment scenarios
addComponent(new Link("Navigate away", new ExternalResource(
"slowRequestHandler")));
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// System.out.println("Continuing poll request");
}
});
setPollingInterval(3000);
}
});
// Hacky URLs that are might not work in all deployment scenarios
addComponent(new Link("Navigate away", new ExternalResource(
"slowRequestHandler")));
addComponent(new Link("Start download", new ExternalResource(
"slowRequestHandler?download")));
}
protected void setup(VaadinRequest request) {
addComponent(new ProgressIndicator() {
{
registerRpc(new ProgressIndicatorServerRpc() {
@Override
public void poll() {
// System.out.println("Pausing poll request");
try {
// Make the XHR request last longer to make it
// easier to click the link at the right moment.
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// System.out.println("Continuing poll request");
}
});
setPollingInterval(3000);
}
});
// Hacky URLs that are might not work in all deployment scenarios
addComponent(new Link("Navigate away", new ExternalResource(
"slowRequestHandler")));
addComponent(new Link("Start download", new ExternalResource(
"slowRequestHandler?download")));
}