pca Report post Posted October 28, 2008 Hello everyone, I'm using Java to create the XML data required for the Fusion Charts. I create a string containing the xml code and then pass it to the Chart with setDataXML. The chart will load with data obtained from a DB and that data may change if a new timeline is selected. I'm trying to create a pie chart with a link to a javascript function. Here is where things get tricky. If I do: xmlStr += " link="JavaScript:jsMethod('" + parameter + "')"" ; the chart loads correctly at first, but if I try to get a different set of data it will return 'Invalid XML data' If I try: xmlStr += " link="JavaScript:jsMethod('" + parameter + "')"" ; the page loads with 'Invalid XML data' but it works fine when selecting a different set of data. The same happens if I try: xmlStr += " link='JavaScript:jsMethod(& apos;" + parameter + "& apos; )'" ; (In my code the & apos; is together) Any idea of what is wrong? Does the setDataXML method do something different the first time it is called from following calls? Thanks in advance Share this post Link to post Share on other sites
Arindam Report post Posted October 29, 2008 (edited) Hi, Could you please use this? If you are using DataXML method please use this xmlStr += " link='JavaScript:jsMethod(%26apos;" + parameter + "%26apos; )'" ; If you are using DataURL method please use this xmlStr += " link='JavaScript:jsMethod('" + parameter + "' )'" ; Edited October 29, 2008 by Guest Share this post Link to post Share on other sites
pca Report post Posted October 29, 2008 xmlStr += " link='JavaScript:jsMethod(%26apos;" + parameter + "%26apos; )'" ; It worked Thank you very much. But any idea on the reason of the problem? Share this post Link to post Share on other sites
Arindam Report post Posted October 29, 2008 Hi, Due to Query String [&] is represent field separator in flash object. That Share this post Link to post Share on other sites
pca Report post Posted October 29, 2008 Hi First of all a correction. In my first post where it says If I do: xmlStr += " link="JavaScript:jsMethod('" + parameter + "')"" ; should be: xmlStr += " link=& quot;JavaScript:jsMethod('" + parameter + "')& quot;" ; I can see now why it would return 'Invalid XML data'. But I still can't understand why it wouldn't return that error on all ocasions. Share this post Link to post Share on other sites