Hi,I wanted to show intermidiate steps to user after calling the lotusscript agent by ajax.
I tried this by following way but it is showing all the data after finishing the running of the agent →
Client Side -
<input type=“button” onclick="window.document.forms[0].Submit.disabled=true;
var i;
var xmlHttp;
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
//xmlHttp.overrideMimeType(‘text/xml’);
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==4 && xmlHttp.status == 200)
{
NodeList = xmlHttp.responseXML.getElementsByTagName("ResultText");
for (i=0; i<NodeList.length; i++)
{
var msg = NodeList[i].childNodes[0].nodeValue;
//msg = fnTrim(msg);
objDiv = document.getElementById("DivAjaxResponse");
objDiv.innerHTML = msg;
}
}
else if(xmlHttp.readyState==4 && xmlHttp.status != 200) { alert("error in AJAX return : " + xmlHttp.status);}
}
xmlHttp.open("GET","/" + window.document.forms[0].DBPath.value + "/(agAjaxIntermediateProgress)?OpenAgent",true);
xmlHttp.send(null);
function fnTrim(strText) {
// this will get rid of leading spaces
while (strText.substring(0,1) == ' ')
strText = strText.substring(1, strText.length);
// this will get rid of trailing spaces
while (strText.substring(strText.length-1,strText.length) == ' ')
strText = strText.substring(0, strText.length-1);
return strText;
} // End Function fnTrim() " value=“Submit” id=“Submit”>
Server Side (LS Agent - “agAjaxIntermediateProgress”) -
Sub Initialize
Print {Content-Type: text/xml}
Print {<?xml version="1.0" encoding="UTF-8" ?>}
Print {<HeaderElement>}
Print {<ResultText>}
Print "Intialising...."
Print {</ResultText>}
Sleep 2
Print {<ResultText>}
Print "Step 1 completed."
Print {</ResultText>}
Print {</HeaderElement>}
End Sub
Desired Result -
-
Initialing…
-
(Wait of 2 Seconds)
-
Step 1 completed
Actual Result -
-
(Wait of 2 Seconds)
-
Initialing…
-
Step 1 completed
Anybody please suggest how to get disired output?