session confusion
I'm trying to create dynamic charts with ZGDChart and a python script by passing values to the script from a page template form using session data. It's working correctly in Mozilla. However, in Internet Explorer, it only works correctly the first time the form is submitted. After that, the chart continues to use the initial values each time. I can see that the session data values are getting updated but the script isn't getting the new values. Below is an example that illustrates the behavior. Any suggestions as to what might be going on? I create a default ZGDChart object and set it to Chart Type "Line_2D" and then select Python Script as the Data Method and test.py as the selected script. ------------ test.py ------------- session = context.session_data_manager.getSessionData() return [(i, i) for i in session.get('start'), session.get('end')] ------------ test.pt ------------- <html> <head> <title tal:content="template/title">The title</title> </head> <body> <div tal:define="global submit request/form/submit | nothing"> <form action="test.pt" method="POST"> Start: <input tal:attributes="value request/form/start | nothing" type="text" name="start" value=""><br> End: <input tal:attributes="value request/form/end | nothing" type="text" name="end" value=""><br> <input type="Submit" name="submit" value="Plot Specified Range"> </form> </div> <div tal:condition="submit"> <span tal:define="dummy python:request.SESSION.set('start', request.form.get('start')); dummy python:request.SESSION.set('end', request.form.get('end'))"> <p><b>Plotting range from <span tal:content="request/form/start">start</span> to <span tal:content="request/form/end">end</span></b></p> <img src="testchart"> </span> </div> </body> </html>
Sounds like a browser caching issue to me. Try pressing shift-reload within IE on the rendered page and see if it gets updated. If so, you'll need to set caching headers on the rendered page that tell IE not to so aggressively cache the page ("Cache-Control" and Pragma: no-cache" come to mind). On Tue, 2003-09-02 at 21:49, Michael Hauser wrote:
I'm trying to create dynamic charts with ZGDChart and a python script by passing values to the script from a page template form using session data. It's working correctly in Mozilla. However, in Internet Explorer, it only works correctly the first time the form is submitted. After that, the chart continues to use the initial values each time. I can see that the session data values are getting updated but the script isn't getting the new values.
Below is an example that illustrates the behavior. Any suggestions as to what might be going on?
I create a default ZGDChart object and set it to Chart Type "Line_2D" and then select Python Script as the Data Method and test.py as the selected script.
------------ test.py -------------
session = context.session_data_manager.getSessionData() return [(i, i) for i in session.get('start'), session.get('end')]
------------ test.pt -------------
<html> <head> <title tal:content="template/title">The title</title> </head> <body>
<div tal:define="global submit request/form/submit | nothing"> <form action="test.pt" method="POST"> Start: <input tal:attributes="value request/form/start | nothing" type="text" name="start" value=""><br> End: <input tal:attributes="value request/form/end | nothing" type="text" name="end" value=""><br> <input type="Submit" name="submit" value="Plot Specified Range"> </form> </div>
<div tal:condition="submit">
<span tal:define="dummy python:request.SESSION.set('start', request.form.get('start')); dummy python:request.SESSION.set('end', request.form.get('end'))">
<p><b>Plotting range from <span tal:content="request/form/start">start</span> to <span tal:content="request/form/end">end</span></b></p> <img src="testchart"> </span> </div> </body> </html>
______________________________________________________________________
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Chris McDonough -
Michael Hauser