[Zope] Maintain Input Variables around forms

McDonnell, Larry lmcdonnell@protonenergy.com
Mon, 11 Nov 2002 10:22:12 -0500


Hi,

I am having a problem maintaining my input variable throughout the data
input process. First, I ask the user to input a record number so they can
add information to the main record. The first time through the form does not
error out and the new record is written. 

Write record after submit

<dtml-call "REQUEST.set('nc_report_no', REQUEST.SESSION['nc_report_no'])">

<dtml-in nonc_disposition_search sort=nc_report_no reverse size=1
start=query_start> ("archive the record")
<dtml-call "REQUEST.set('line_item_number', line_item_number)">
</dtml-in>

<dtml-call expr="update_nonc_partb_record(REQUEST)">
<p> Thanks information has been saved. </p>

<p><a href="update_nonc_partb">Add More Dispositions</a></p>
<p><a href="index_html">Back to Main Page</a></p>
<p>&nbsp; </p>


If they need to create additional records, I give them a link to go back the
input inform. This is where the problem starts. If I use the following:

Form

<dtml-in lookup_nc_report_no_query>

I'll get an in "Missing input variable, nc_report_no"
If I add this to the input form and start with a fresh browser window:
Form

<dtml-call "REQUEST.set('nc_report_no', REQUEST.SESSION['nc_report_no'])">
<dtml-call "REQUEST.SESSION.set('nc_report_no', nc_report_no)">


<dtml-in lookup_nc_report_no_query>
I will see this error: Error Type: KeyError Error Value: nc_report_no

Is there a way to set the variable globally and avoid the keyerror issue.
Thanks


Larry McDonnell

Proton Energy Systems
10 Technology Drive
Wallingford, CT 06492
(203) 678-2181
Email:lmcdonnell@protonenergy.com
www.protonenergy.com