[Zope-dev] REQUEST contains wrong list.index ???

Robert Rottermann robert@rocad.ch
Thu, 26 Apr 2001 08:37:03 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0070_01C0CE2C.11CFD550
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Good morning,
=20
I came accross something I do not understand:
=20
In a form I have list. The list items are set with an option value <>
the sequence-index
like so:
          <dtml-in getSubprojects>
            <dtml-let curElem=3Dsequence-item>
                <OPTION value=3D<dtml-var "curElem['Code']">>
                  <dtml-var "curElem['Name']">
                </OPTION>
            </dtml-let>
          </dtml-in>=20

Now my question:
In the forms action I ask for the selected item in a python script
like so:
    listVal =3D 0
    try:
      listVal =3D _['listProject']
    except:
      pass

To my puzlement listVal contains the index of the selected item, not
it's <option value> which I would like to gather.
=20
Where is my error?
=20
Thanks for your answers
=20
Robert


------=_NextPart_000_0070_01C0CE2C.11CFD550
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c8e0d8>
<DIV><FONT face=3DArial size=3D2>Good morning,<BR>&nbsp;<BR>I came =
accross something=20
I do not understand:<BR>&nbsp;<BR>In a form I have list. The list items =
are set=20
with an option value &lt;&gt;<BR>the sequence-index<BR>like=20
so:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&lt;dtml-in=20
getSubprojects&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;=20
&lt;dtml-let=20
curElem=3Dsequence-item&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;OPTION value=3D&lt;dtml-var=20
"curElem['Code']"&gt;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;dtml-var=20
"curElem['Name']"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/OPTION&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
&lt;/dtml-let&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
&lt;/dtml-in&gt; <BR><BR>Now my question:<BR>In the forms action I ask =
for the=20
selected item in a python script<BR>like so:<BR>&nbsp;&nbsp;&nbsp; =
listVal =3D=20
0<BR>&nbsp;&nbsp;&nbsp; try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listVal =
=3D=20
_['listProject']<BR>&nbsp;&nbsp;&nbsp; =
except:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
pass<BR><BR>To my puzlement listVal contains the index of the selected =
item,=20
not<BR>it's &lt;option value&gt; which I would like to=20
gather.<BR>&nbsp;<BR>Where is my error?<BR>&nbsp;<BR>Thanks for your=20
answers<BR>&nbsp;<BR>Robert<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0070_01C0CE2C.11CFD550--