[Zope] session confusion

Michael Hauser hauser at namecraft.com
Tue Sep 2 19:49:29 EDT 2003


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>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.zope.org/pipermail/zope/attachments/20030902/e00c848f/attachment.htm


More information about the Zope mailing list