Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Page update indicator still visible after serving resources
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.
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?
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: <%= user.getUserId() %>,
<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 + "&jobId=" + responseData.result + "&userId=" + <%= user.getUserId() %>;
} 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?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™