Posted by Andrew Wan
on 30.01.2008 14:22
OpenRico 2.0 is cool. But somehow the LiveGrid table don't work if I run 
Visual Studio 2003.NET in debug mode. The AJAX responses always come 
back prefixed with

<!-- DEBUG META INFO
 -->


Is there a way in OpenRico to handle this? Where can i find the AJAX 
response bit in OpenRico?
Posted by Matt Brown
on 31.01.2008 02:30
The AJAX response is generated by ricoXMLquery.aspx. It expects several 
parameters to be passed in via the query string, and the base sql query 
to be stored in a session variable.

If you download the new rc1 release, there is an example called 
ex2debug.aspx. Running it will yield a long list of debug messages 
displayed in a textarea. Among the messages will be ones like this:

1969: Ajax.Request.request: id=ex2&page_size=168&offset=0&get_total=true

This is the query string passed to ricoXMLquery.

Matt
Posted by Andrew Wan
on 19.03.2008 12:11
Just diff this function with the original and you see it's a couple of 
added lines to handle VS debugging...

Rico.Buffer.AjaxXMLMethods.prototype.ajaxUpdate = 
function(startPos,request) {
    this.clearTimer();
    this.processingRequest=false;
    if (request.status != 200) {
      Rico.writeDebugMsg("ajaxUpdate: received http 
error="+request.status);
      this.liveGrid.showMsg('Received HTTP error: '+request.status);
      return;
    }

    // The response text may contain ASP META DATA for debugging if 
client side debugging is enabled
    var xmlDoc = request.responseXML;

    if (request.responseText.substring(0, 12) == "<!--METADATA") {
		var nEnd = request.responseText.indexOf("-->");
		if (nEnd == -1) {
	        this.liveGrid.showMsg('Web server error - client side debugging 
enabled: ');
			return;
		}
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.loadXML(request.responseText.substring(nEnd+3));
	}

    var response = xmlDoc.getElementsByTagName("ajax-response");
    if (response == null || response.length != 1) return;
    this.updateBuffer(response[0],startPos);
    if (this.options.onAjaxUpdate)
      this.options.onAjaxUpdate();
    this.updateGrid(startPos);
    if (this.options.TimeOut && this.timerMsg)
      this.restartSessionTimer();
    if (this.pendingRequest>=0) {
      var offset=this.pendingRequest;
      Rico.writeDebugMsg("ajaxUpdate: found pending request for 
offset="+offset);
      this.pendingRequest=-1;
      this.fetch(offset);
    }
  };