View Single Post
Old 12-17-2012, 10:28 AM   PM User | #1
penser
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
penser is an unknown quantity at this point
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
penser is offline   Reply With Quote