|
Invoking servlet with xhttp and status messages
I have an issue to save a long base64 String to a database/file.
I would like to show some message/status in a text field like 'Writting...' before and than use download function (which calls a servlet) like this:
function doDownload(pageId) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
displayStatus('Ready');
};
xhttp.open("GET", "http://127.0.0.1:7101/testApp/images?pageId=" + pageId, false);
xhttp.send();
}
However, when I call a function to display status 'Writting' at the beginning:
function displayStatus(status) {
var field = AdfPage.PAGE.findComponentByAbsoluteId('itStatus');
if (field) {
field.setValue(status);
}
}
It is not displaying the message 'Writting' (probably because it all happens in a one thread.
Could you forum users tell me how to show a status message before really invoking servlet action?
kind regards,
Christopher
|