ER: [Zope] ZGDChart tips?

Igor Leturia IGOR@emun.com
Tue, 29 Apr 2003 17:33:26 +0200


>
>Here's how a simple report goes  Pages 1 & 2 are forms.
>
>Page 1: User choose year of class (classyear) and year of assessment=20
>(testyear). [Submit]
>
>Page 2: ZSQL query lists tests for that class and year.  User picks=20
>the test they want a report on (test_id). [Submit]
>
>Page 3: Displays a table of min / max / mean scores of nonzero=20
>objectives for the test through ZSQL calls -- passing test_id,=20
>classyear, and objective name.
>
>How do I pass the form variables into the DTML used by ZDGChart?
>

I had the same problem. I used the SESSION variable.

In page 1 and page 2, you can pass the form variables like this:

<dtml-let sesdat=3D"session_data_manager.getSessionData()">
  <dtml-call "sesdat.set('var1',value1)">
  <dtml-call "sesdat.set('var2',value2)">
  ...
</dtml-let>

In the DTML used by ZGDChart, you can read the variables like this:

<dtml-call "REQUEST.set('graphdata',[])">
<dtml-let data=3D"session_data_manager.getSessionData()">
  <dtml-call "graphdata.append(datuak.get('var1'))">
  <dtml-call "graphdata.append(datuak.get('var2'))">
  ...
</dtml-let>
<dtml-return graphdata>

Hope it helps.

			Igor Leturia