I am using a Flash chart to display data. It has an attribute ‘refreshUrl’ which is used to refresh the data every 60 seconds.
The problem is that the url is always the same and it never receives the latest data.
In javascript I know we can append “new Date().getTime()” to a url to prevent caching but we set the refreshUrl in such a way that it is not possible to append the time to the url.
This is how I am declaring the pie chart (this is done only once):
cfm_PieChart = new SWFObject("<%=contextPath%>/cuecharts/piechart.swf?t=" + new Date().getTime(), "alarmCountBySeverityPiechart", "100%", "100%", "9", "#869ca7");
cfm_PieChart.addVariable("chartdefxml", "<chart row='row' labelFormat='pctOutsideParenthesis' enableDataGridView='true' togglePosition='bottom' useStateColorPalette='true' dataChangeEffect='interpolate' dataChangeEffectDuration='1500' refreshUrl='<%=contextPath%>/pie.jsp' refreshFrequency='60000' ><series><pieseries field='Count' nameField='Severity' stateValueField='StateKey' labelPosition='callout' /></series><legend placement='left' legendItemsDirection='vertical'/></chart>");
Notice the ‘refreshUrl’ attribute in the cfm_PieChart.addVariable() call. I tried the following:
refreshUrl:='>%=contextPath%>/pie.jsp?t=javascript:new Date().getTime()'
and
refreshUrl:='>%=contextPath%>/pie.jsp?t=new Date().getTime()'
Any ideas?
Thanks
Fixed it by adding the following in my jsp: