Thank you. That was my problem. I was not reading and returning the
reqId properly. Now it works fine with multiple.

On Nov 15, 11:52 am, VizGuy <[EMAIL PROTECTED]> wrote:
> Please make sure that the requestId field in the json is not the same for
> both your responses.
> This might cause exactly the problem you describe, and from the examples you
> sent it is not clear if you have it right.
>
> Generally, the request id field is sent in the request, and the same value
> should be sent in the response back to the client.
> Since all of the responses are processed by the same static function, this
> is how they are synchronized.
> If you send back requestId:0 for both of them, they will both be processed
> as the response for the first one, and override each other, while the second
> query is left without response.
>
> VizGuy
>
> On Fri, Nov 14, 2008 at 8:49 PM, jalbrecht <[EMAIL PROTECTED]> wrote:
>
> > Just some more debug info.
>
> > I created a txt file with the exact response from the spreedsheet (the
> > one listed in my previous post), pointed the Query object to that url
> > and it still only displays one table.
>
> > I moved the text file to a different server (both were IIS7) and still
> > same issue.
>
> > I put an alert in the function isResponseOK and when I only call the
> > spread sheets, it pops up twice real quick. If I call my server and
> > the call anything else (spread sheet or my server) the first alert
> > pops up right away, table is displayed, and the second alert does not
> > show for about 30 seconds (time out?) and no 2nd table is ever
> > displayed in the browser.
>
> > On Nov 14, 10:06 am, jalbrecht <[EMAIL PROTECTED]> wrote:
> > > Yes when I switch the urls to the spreadsheet it works fine as well I
> > > get multiple tables.
>
> > > The problem appears to be with my json_data.aspx page. I've even
> > > copied the exact response from the spreadsheet and made my page only
> > > return that. It still does not show more than one table. Looking at
> > > the
>
> > > Any idea what could be the issue in my response? I'm just send text/
> > > plain content-type just like the spread sheet. I can't see to figure
> > > out what is different.
>
> > > Here is the RAW values from Fiddler from my page and google's:
>
> > > [GOOGLE]
>
> > > HTTP/1.1 200 OK
> > > Content-Type: text/plain; charset=utf-8
> > > Date: Fri, 14 Nov 2008 17:43:09 GMT
> > > Expires: Fri, 14 Nov 2008 17:43:09 GMT
> > > Cache-Control: private, max-age=0
> > > Content-Length: 536
> > > Set-Cookie: S=trix=gijqqPd8N8A; Path=/
> > > Server: GFE/1.3
>
> > > google.visualization.Query.setResponse
> > > ({requestId:'0',status:'ok',signature:'2758741876566790732',table:
> > > {cols: [{id:'A',label:'Place / Movie',type:'t',pattern:''},
> > > {id:'B',label:'London',type:'n',pattern:'#0.###############'},
> > > {id:'C',label:'Paris',type:'n',pattern:'#0.###############'},
> > > {id:'D',label:'Moscow',type:'n',pattern:'#0.###############'}],rows:
> > > [[{v:'Pi'},{v:5.0,f:'5'},{v:25.0,f:'25'},{v:7.0,f:'7'}],[{v:'Requiem'},
> > > {v:8.0,f:'8'},{v:20.0,f:'20'},{v:30.0,f:'30'}],[{v:'Fountain'},{v:
> > > 1.0,f:'1'},{v:3.0,f:'3'},{v:6.0,f:'6'}]]}});
>
> > > [MINE]
>
> > > HTTP/1.1 200 OK
> > > Cache-Control: private
> > > Content-Type: text/plain; charset=utf-8
> > > Vary: Accept-Encoding
> > > Server: Microsoft-IIS/7.0
> > > X-AspNet-Version: 2.0.50727
> > > X-Powered-By: ASP.NET
> > > Date: Fri, 14 Nov 2008 17:43:07 GMT
> > > Content-Length: 536
>
> > > google.visualization.Query.setResponse
> > > ({requestId:'1',status:'ok',signature:'2758741876566790732',table:
> > > {cols: [{id:'A',label:'Place / Movie',type:'t',pattern:''},
> > > {id:'B',label:'London',type:'n',pattern:'#0.###############'},
> > > {id:'C',label:'Paris',type:'n',pattern:'#0.###############'},
> > > {id:'D',label:'Moscow',type:'n',pattern:'#0.###############'}],rows:
> > > [[{v:'Pi'},{v:5.0,f:'5'},{v:25.0,f:'25'},{v:7.0,f:'7'}],[{v:'Requiem'},
> > > {v:8.0,f:'8'},{v:20.0,f:'20'},{v:30.0,f:'30'}],[{v:'Fountain'},{v:
> > > 1.0,f:'1'},{v:3.0,f:'3'},{v:6.0,f:'6'}]]}});
>
> > > On Nov 14, 12:27 am, VizGuy <[EMAIL PROTECTED]> wrote:
>
> > > > I copied the code here,  modified the urls to some publisc spreadsheets
> > (http://spreadsheets.google.com/pub?key=pCQbetd-CptF0r8qmCOlZGg) and it
> > > > worked well for me...
>
> > > > Either there is a problem with the second url, or that you have some
> > error
> > > > in the code out of the snippet here...
>
> > > > VizGuy
>
> > > > On Fri, Nov 14, 2008 at 3:56 AM, jalbrecht <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > Greetings,
>
> > > > > I want to create a dashboard of multiple tables, charts, pies, etc.
> > > > > that all call for there data independently via json.
>
> > > > > I got my first visualization table working perfectly via the
> > query.send
> > > > > () call, however when I add a second call, only the first one is
> > drawn
> > > > > and the other table appear to time out.
>
> > > > > What am I doing wrong?
>
> > > > > Here is my code:
>
> > > > >   <script type="text/javascript">
> > > > >        google.load("visualization", "1", { packages: ["table"] });
> > > > >        google.setOnLoadCallback(initialize);
>
> > > > >        function initialize() {
> > > > >            // The URL here is the URL of the JSON data.
> > > > >            var stats_query = new google.visualization.Query('http://
> > > > > jalbrecht.loopnet.com:81/json_data.aspx?d=Stats')
> > > > >            stats_query.send(drawStatsChart);
>
> > > > >            var sales_query = new google.visualization.Query('http://
> > > > > jalbrecht.loopnet.com:81/json_data.aspx?d=Sales')
> > > > >            sales_query.send(drawSalesChart);
> > > > >        }
>
> > > > >        function drawStatsChart(response) {
> > > > >            if (isResponseOK(response, document.getElementById
> > > > > ('StatsTable_div'))) {
> > > > >                //No error go for it.
> > > > >                var data = response.getDataTable();
> > > > >                var table = new google.visualization.Table
> > > > > (document.getElementById('StatsTable_div'));
> > > > >                var formatter = new
> > > > > google.visualization.TableArrowFormat();
> > > > >                formatter.format(data, 3); // Apply formatter to
> > > > > column
> > > > >                table.draw(data, { allowHtml: true, showRowNumber:
> > > > > false });
> > > > >            }
> > > > >        }
>
> > > > >        function drawSalesChart(response) {
> > > > >            if (isResponseOK(response, document.getElementById
> > > > > ('SalesTable_div'))) {
> > > > >                //No error go for it.
> > > > >                var data = response.getDataTable();
> > > > >                var table = new google.visualization.Table
> > > > > (document.getElementById('SalesTable_div'));
> > > > >                table.draw(data, { allowHtml: true, showRowNumber:
> > > > > false });
> > > > >            }
> > > > >        }
>
> > > > >        function isResponseOK(response, el) {
> > > > >            //Check response object for error info.
> > > > >            if (response.isError()) {
> > > > >                //alert('uh oh!');
> > > > >                //Display error info in target element.
> > > > >                el.innerHTML = response.getDetailedMessage();
> > > > >                return false;
> > > > >            } else {
> > > > >                return true;
> > > > >            }
> > > > >        }
> > > > >    </script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to