Page update indicator still visible after serving resources

Jan Tošovský, modified 6 Years ago. Liferay Master Posts: 576 Join Date: 7/22/10 Recent Posts
Dear All,

in my case I am serving resource by two chained requests. Initialy I am getting a token via XHR and if I receive it, it is used for final downloading the resource.

function callServeResource(id) {

    AUI().use('aui-io-request', 'liferay-portlet-url', function(A) {
        A.io.request('<portlet:resourceurl id="installer-queue" />', {
            method: 'post',
            data: {
                <portlet:namespace />userId: &lt;%= user.getUserId() %&gt;,
                <portlet:namespace />id: id
            },
            on: {
                success: function(e) {

                    var responseData = JSON.parse(this.get("responseData"));

                    if (responseData !== null) {
                        if (responseData.result) {
                            window.location = "/c/installers/get_file?id=" + id + "&amp;jobId=" + responseData.result + "&amp;userId=" + &lt;%= user.getUserId() %&gt;;

                        } else if (responseData.error) {
                            showAlert(responseData.error);
                        }
                    }
                },
                failure : function() {
                    showAlert("Bad request");
                }
            }
        });
    });
}

Even the file is downloaded successfully, I can still see that page progress strip at the top of the page.

I suppose changing the window.location should be replaced by something better.

Any advice?