Re: Problem with generated javascript and zone update

2012-03-12 Thread David Canteros
Hi, thanks for the response.
Probably you are right. I'm not an ajax/js expert, so the only thing I can
did is check the "response"  when the zone is updated (using firebug
console) and I can see the generated script inside a JSON variable called "*
evalScript*", i think. I dont know why it is not executed (problems with
the quote, maybe?).

The response (from firebug console):

{  "content" : "<\/input><\/input><\/div><\/div><\/input><\/input><\/form><\/html><\/div>",
"scripts" : ["/assets/1.3.4/ctx/js/amcharts.js",
"/assets/1.3.4/ctx/js/raphael.js",
"/assets/1.3.4/ctx/js/SvgToCanvas.js"  ],  "inits" : [{
"formEventManager" : [{  "formId" :
"reportExecutionForm_13607275c88",  "validate" : {
"submit" : true,"blur" : true  }}  ]
 },{ * "evalScript" : [**"var chart; var chartData =
[{month: \"01-2011\",travel: 6688.0,training: 3705.0,cumulative:
10393.0,budget: 0.0},{month: \"02-2011\",travel: 3135.0,training:
7593.0,cumulative: 21121.0,budget: 0.0},{month: \"03-2011\",travel:
3490.0,training: 7555.23,cumulative: 32166.23,budget: 0.0},{month:
\"04-2011\",travel: 8696.0,training: 2091.0,cumulative:
42953.23,budget: 0.0},{month: \"05-2011\",travel: 15912.0,training:
5416.0,cumulative: 64281.23,budget: 0.0},{month: \"06-2011\",travel:
13657.4499,training: 3832.0,cumulative: 81770.68,budget:
0.0},{month: \"07-2011\",travel: 7491.3899,training:
4857.0,cumulative: 12348.39,budget: 0.0},{month: \"08-2011\",travel:
5517.5999,training: 2207.0,cumulative: 20072.99,budget:
0.0},{month: \"09-2011\",travel: 17166.18,training:
12551.0,cumulative: 49790.17,budget: 0.0},{month: \"10-2011\",travel:
4151.67,training: 1483.0,cumulative: 55424.8404,budget:
0.0},{month: \"11-2011\",travel: 15269.7,training: 10241.0,cumulative:
80935.541,budget: 0.0},{month: \"12-2011\",travel:
13838.3,training: 1608.0,cumulative: 96381.843,budget:
990993.0},{month: \"01-2012\",travel: 4727.59,training:
3954.0,cumulative: 8681.59,budget: 990993.0}];AmCharts.ready(function
() { chart = new AmCharts.AmSerialChart(); chart.dataProvider =
chartData;  chart.categoryField = \"month\";chart.startDuration =
1;chart.rotate = false;chart.depth3D = 20;chart.angle = 45;
chart.addTitle(\"Training budget tracking for MS\", 14);var
categoryAxis = chart.categoryAxis;categoryAxis.gridPosition =
\"start\"; categoryAxis.axisColor = \"#DADADA\";  categoryAxis.title =
\"Months  \";categoryAxis.dashLength = 5;categoryAxis.labelRotation =
45;var valueAxis0 = new AmCharts.ValueAxis(); valueAxis0.stackType =
\"regular\"; valueAxis0.title = \"Travel and training costs
\";valueAxis0.gridAlpha = 0.1; valueAxis0.axisAlpha =
0;chart.addValueAxis(valueAxis0);var valueAxis1 = new
AmCharts.ValueAxis(); valueAxis1.stackType = \"regular\";
valueAxis1.title = \"Cumulative costs and Budget\";
valueAxis1.gridAlpha = 0.1; valueAxis1.axisAlpha = 0;
valueAxis1.synchronizationMultiplyer =
1;valueAxis1.synchronizeWithAxis(valueAxis0);valueAxis1.position =
\"right\";chart.addValueAxis(valueAxis1);var graph1 = new
AmCharts.AmGraph(); graph1.type = \"column\";graph1.title = \"Travel
cost (flight + expenses)\";graph1.valueField = \"travel\";
graph1.fillColors = \"#8414A5\";graph1.lineAlpha = 0;graph1.fillAlphas
= 1;graph1.axisColor=\"#ADD981\";chart.addGraph(graph1);var graph2 =
new AmCharts.AmGraph(); graph2.type = \"column\";graph2.title =
\"Training cost (fee)\";graph2.valueField = \"training\";
graph2.fillColors = \"#84CB7B\";graph2.lineAlpha = 0;graph2.fillAlphas
= 1;graph2.axisColor=\"#ADD981\";chart.addGraph(graph2);var graph3 =
new AmCharts.AmGraph(); graph3.type = \"line\";graph3.title =
\"Cumulative cost\";graph3.valueField = \"cumulative\";
graph3.lineColor = \"#FFA218\";graph3.lineThickness = 3;graph3.bullet
= \"round\"; graph3.fillAlphas =
0;graph3.axisColor=\"#ADD981\";graph3.valueAxis=valueAxis0;chart.addGraph(graph3);var
graph4 = new AmCharts.AmGraph(); graph4.type = \"line\";graph4.title =
\"Budget\";graph4.valueField = \"budget\"; graph4.lineColor =
\"red\";graph4.lineThickness = 3;graph4.bullet = \"round\";
graph4.fillAlphas =
0;graph4.axisColor=\"#ADD981\";graph4.valueAxis=valueAxis1;chart.addGraph(graph4);var
legend = new AmCharts.AmLegend(); chart.addLegend(legend);
chart.wr

Re: Problem with generated javascript and zone update

2012-03-09 Thread trsvax
My guess would be there is something in your script that cannot be sent in a
JSONObject. Without a zone the script is just included in the HTML but a
zone update returns a JSONObject and there are rules about what can be
included. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-generated-javascript-and-zone-update-tp5550938p5551858.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org