Focal Point
[CLOSED] Ajax Not Working Inside -HTMLFORM

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8037090726

December 13, 2012, 09:39 AM
Ramkumar - Webfous
[CLOSED] Ajax Not Working Inside -HTMLFORM
I am trying to use AJAX inside a HTMLFORM - while implementing drilldown report and it does'nt work properly. It is giving a access denied error even though I am trying to access things with in the same domain.

Any inputs to this?

 TABLE FILE CAR
SUM DEALER_COST
ACROSS COUNTRY
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, BACKCOLOR='NONE',
STYLE=NORMAL,$
TYPE=DATA, ACROSSCOLUMN=N1, JAVASCRIPT=runReport(),$
ENDSTYLE
END
-HTMLFORM BEGIN
<html>
<script language="Javascript" type="text/javascript">
function createRequestObject() {
    var tmpXmlHttpObject;
    if (window.XMLHttpRequest) { 
        tmpXmlHttpObject = new XMLHttpRequest();
    } else if (window.ActiveXObject) { 
        tmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return tmpXmlHttpObject;
}

var http = createRequestObject();

function makeGetRequest() {
    var uri = 'https://myserver:port/ibi_apps/WFServlet?IBIF_ex=trainingtest/cardetails';
     uri += '%26IBI_app=trainingtest'   ;
    alert(unescape(uri));
	http.open('get', unescape(uri));
    http.onreadystatechange = processResponse;
    http.send(null);
}

function processResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById('description').innerHTML = response;
    }
}
function runReport() {
 makeGetRequest();
 processResponse();
}
</script>
<body>
<div id="description"></div>
</body>
</html>
-HTMLFORM END


When I am trying the same snippet in the HTML file inside the composer, it works picture perfect.

This message has been edited. Last edited by: Kerry,


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
December 13, 2012, 10:45 AM
Francis Mariani
I made a minor change to the URI and this works for me - running either from Dev Studio, or from a URL.

var uri = '/ibi_apps/WFServlet?IBIF_ex=car1%26IBIAPP_app=test';

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server