On Mon, Mar 6, 2017 at 11:06 PM, Sergiu <sergiuhli...@gmail.com> wrote:

> Hello,
> I have a main Panel implementing IAjaxIndicatorAware . The panel contains
> multiple AjaxTabbedPanel. and in one tab I have a form with a list of items
> and an AjaxButton that I use to trigger a download based on selected items.
> Now the content of the AjaxButton looks like this:
> AbstractResourceStreamWriter resourceStream = new
> AbstractResourceStreamWriter() {
>         @Override
>         public void write(OutputStream output) throws IOException {
>                 writeFileContent(output);
>         };
> ResourceStreamRequestHandler handler = new
> ResourceStreamRequestHandler(resourceStream, "Package.zip")
> getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);

The problem starts here.
getRequestCycle().scheduleRequestHandlerAfterCurrent(handler) basically
tells Wicket to throw away the AjaxRequestHandler and thus there is no Ajax
(XML) response that will hide the loading indicator.

To accomplish what you need you need to use
The idea is that the Ajax response is a normal XML response that also
contains a redirect command that will trigger the download of the bibary in
another (non-Ajax) request.

This solution is used by many applications so we decided to include it in
Wicket itself: https://issues.apache.org/jira/browse/WICKET-6286

> ignore the ignore the
> It seems that scheduleRequestHandlerAfterCurrent leaves the busy indicator
> spinning forever after the download of the file gets completed. Is there
> anything that I am missing or is this a bug?
> I'm using Wicket 7.3
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/
> IAjaxIndicatorAware-busy-indicator-running-forever-tp4677251.html
> Sent from the Users forum mailing list archive at Nabble.com.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to