[Zope] <input type=hidden value='<dtml-var x>' name=x> and L
OOP
servel yannick
yservel@glam.ac.uk
Fri, 23 Mar 2001 19:53:58 -0000
hi, servel
stringify your i's:
s = s + "<input type=hidden value='%s' name='filename%s'>" %
((REQUEST.filename + str(i)), i)
or you can
iterator = str(i)
s = s + "<input type=hidden value='%s' name='filename%s'>" %
((REQUEST.filename + iterator)), iterator)
-----------------------------------------------------
Hello Jim,
I already tried to stringified my i's during my preview attempts.
Here is the message error I received when I attempted to use this kind of
solutions:
<html><head><title>yannick</title></head><body bgcolor="#FFFFFF">
<table border="0" width="100%">
<tr valign="TOP">
<td width="10%" align="center">
<img src="http://ltg2.comp.glam.ac.uk:8080/p_/ZButton" alt="Zope">
</td>
<td width="90%">
<h2>Zope Error</h2>
<p>Zope has encountered an error while publishing this resource.</p>
<p>
<strong>Error Type: KeyError</strong><br>
<strong>Error Value: filename</strong><br>
</p>
<hr noshade>
<p>Troubleshooting Suggestions</p>
<ul>
<li>This resource may be trying to reference a
nonexistent object or variable <strong>filename</strong>.</li>
<li>The URL may be incorrect.</li>
<li>The parameters passed to this resource may be incorrect.</li>
<li>A resource that this resource relies on may be encountering an
error.</li>
</ul>
<p>For more detailed information about the error, please
refer to the HTML source for this page.
</p>
<p>If the error persists please contact the site maintainer.
Thank you for your patience.
</p>
</td></tr>
</table>
<p><a href="http://www.zope.org/Credits" target="_top"><img
src="http://ltg2.comp.glam.ac.uk:8080/p_/ZopeButton" width="115" height="50"
border="0" alt="Powered by Zope" /></a></p></body></html>
<!--
Traceback (innermost last):
File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 187, in
publish
File C:\PROGRA~1\WebSite\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 171, in
publish
File C:\PROGRA~1\WebSite\lib\python\ZPublisher\mapply.py, line 160, in
mapply
(Object: SaveMenu.html)
File C:\PROGRA~1\WebSite\lib\python\ZPublisher\Publish.py, line 112, in
call_object
(Object: SaveMenu.html)
File C:\PROGRA~1\WebSite\lib\python\OFS\DTMLDocument.py, line 189, in
__call__
(Object: SaveMenu.html)
File C:\PROGRA~1\WebSite\lib\python\DocumentTemplate\DT_String.py, line
538, in __call__
(Object: SaveMenu.html)
File C:\PROGRA~1\WebSite\lib\python\DocumentTemplate\DT_Util.py, line 334,
in eval
(Object: SaveMenu(REQUEST=REQUEST))
(Info: REQUEST)
File <string>, line 0, in ?
File
C:\PROGRA~1\WebSite\lib\python\Products\ExternalMethod\ExternalMethod.py,
line 269, in __call__
(Object: SaveMenu)
(Info: ((), {'REQUEST': <h3>form</h3><table><tr
valign="top"
align="left"><th>filename3</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename2</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename1</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename7</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename6</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>nbMenu</th><td>'7'</td>
;</tr><tr valign="top"
align="left"><th>filename4</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>nbCol</th><td>'3'</td>
</tr><tr valign="top"
align="left"><th>filename5</th><td>''</td&
gt;</tr></table><h3>cookies</h3><table><tr
valign="top"
align="left"><th>tree-s</th><td>'eJzTiFZ3hANP
W/VYHU0ALlYElA'</td></tr></table><h3>other</h3>
;<table><tr valign="top"
align="left"><th>PUBLISHED</th><td>&lt;DT
MLDocument instance at 00FF1860&gt;</td></tr><tr
valign="top"
align="left"><th>nbCol</th><td>'3'</td>
</tr><tr valign="top"
align="left"><th>URL2</th><td>'http://ltg2.co
mp.glam.ac.uk:8080'</td></tr><tr valign="top"
align="left"><th>BASE1</th><td>'http://ltg2.c
omp.glam.ac.uk:8080'</td></tr><tr valign="top"
align="left"><th>BASE0</th><td>'http://ltg2.c
omp.glam.ac.uk:8080'</td></tr><tr valign="top"
align="left"><th>SERVER_URL</th><td>'http://l
tg2.comp.glam.ac.uk:8080'</td></tr><tr valign="top"
align="left"><th>AUTHENTICATED_USER</th><td>y
annick</td></tr><tr valign="top"
align="left"><th>TraversalRequestNameStack</th><
td>[]</td></tr><tr valign="top"
align="left"><th>tree-s</th><td>'eJzTiFZ3hANP
W/VYHU0ALlYElA'</td></tr><tr valign="top"
align="left"><th>AUTHENTICATION_PATH</th><td>
''</td></tr><tr valign="top"
align="left"><th>BASE3</th><td>'http://ltg2.c
omp.glam.ac.uk:8080/yannick/SaveMenu.html'</td></tr><tr
valign="top"
align="left"><th>URL0</th><td>'http://ltg2.co
mp.glam.ac.uk:8080/yannick/SaveMenu.html'</td></tr><tr
valign="top"
align="left"><th>URL1</th><td>'http://ltg2.co
mp.glam.ac.uk:8080/yannick'</td></tr><tr
valign="top"
align="left"><th>filename2</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename3</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>nbMenu</th><td>'7'</td>
;</tr><tr valign="top"
align="left"><th>filename1</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename7</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename6</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename5</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>filename4</th><td>''</td&
gt;</tr><tr valign="top"
align="left"><th>URL</th><td>'http://ltg2.com
p.glam.ac.uk:8080/yannick/SaveMenu.html'</td></tr><tr
valign="top"
align="left"><th>BASE2</th><td>'http://ltg2.c
omp.glam.ac.uk:8080/yannick'</td></tr><tr
valign="top"
align="left"><th>URL0</th><td>http://ltg2.com
p.glam.ac.uk:8080/yannick/SaveMenu.html</td></tr><tr
valign="top"
align="left"><th>URL1</th><td>http://ltg2.com
p.glam.ac.uk:8080/yannick</td></tr><tr valign="top"
align="left"><th>URL2</th><td>http://ltg2.com
p.glam.ac.uk:8080</td></tr><tr valign="top"
align="left"><th>BASE0</th><td>http://ltg2.co
mp.glam.ac.uk:8080</td></tr><tr valign="top"
align="left"><th>BASE1</th><td>http://ltg2.co
mp.glam.ac.uk:8080</td></tr><tr valign="top"
align="left"><th>BASE2</th><td>http://ltg2.co
mp.glam.ac.uk:8080/yannick</td></tr><tr
valign="top"
align="left"><th>BASE3</th><td>http://ltg2.co
mp.glam.ac.uk:8080/yannick/SaveMenu.html</td></tr></table>
<h3>environ</h3><table><tr valign="top"
align="left"><th>SCRIPT_NAME</th><td></td&
gt;</tr><tr valign="top"
align="left"><th>HTTP_ACCEPT_ENCODING</th><td>
;gzip, deflate</td></tr><tr valign="top"
align="left"><th>CONTENT_LENGTH</th><td>93<
;/td></tr><tr valign="top"
align="left"><th>channel.creation_time</th><td&g
t;985376904</td></tr><tr valign="top"
align="left"><th>HTTP_REFERER</th><td>http://
ltg2.comp.glam.ac.uk:8080/yannick/CreateMenu.html?nbMenu=7&amp;nbCol=3&l
t;/td></tr><tr valign="top"
align="left"><th>SERVER_PROTOCOL</th><td>1.1&
lt;/td></tr><tr valign="top"
align="left"><th>CONTENT_TYPE</th><td>applica
tion/x-www-form-urlencoded</td></tr><tr
valign="top"
align="left"><th>PATH_TRANSLATED</th><td>\yan
nick\SaveMenu.html</td></tr><tr valign="top"
align="left"><th>HTTP_ACCEPT</th><td>image/gi
f, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint,
application/vnd.ms-excel, application/msword,
*/*</td></tr><tr valign="top"
align="left"><th>REQUEST_METHOD</th><td>POST&
lt;/td></tr><tr valign="top"
align="left"><th>SERVER_SOFTWARE</th><td>Zope
/Zope 2.3.0 (binary release, python 1.5.2, win32-x86)
ZServer/1.1b1</td></tr><tr valign="top"
align="left"><th>HTTP_COOKIE</th><td>tree-s=&
amp;quot;eJzTiFZ3hANPW/VYHU0ALlYElA&quot;</td></tr><tr
valign="top"
align="left"><th>PATH_INFO</th><td>/yannick/S
aveMenu.html</td></tr><tr valign="top"
align="left"><th>HTTP_ACCEPT_LANGUAGE</th><td>
;en-gb</td></tr><tr valign="top"
align="left"><th>HTTP_HOST</th><td>ltg2.comp.
glam.ac.uk:8080</td></tr><tr valign="top"
align="left"><th>GATEWAY_INTERFACE</th><td>CG
I/1.1</td></tr><tr valign="top"
align="left"><th>SERVER_PORT</th><td>8080<
/td></tr><tr valign="top"
align="left"><th>SERVER_NAME</th><td>ltg2.com
p.glam.ac.uk</td></tr><tr valign="top"
align="left"><th>REMOTE_ADDR</th><td>193.63.1
28.132</td></tr><tr valign="top"
align="left"><th>HTTP_USER_AGENT</th><td>Mozi
lla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)</td></tr><tr
valign="top"
align="left"><th>CONNECTION_TYPE</th><td>Keep
-Alive</td></tr></table>}, (None,)))
File C:\PROGRA~1\WebSite\Extensions\ecommerce.py, line 12, in SaveMenu
(Object: Traversable)
File C:\PROGRA~1\WebSite\lib\python\ZPublisher\HTTPRequest.py, line 852,
in __getitem__
KeyError: (see above)
-->
For some reasons, it refuses to add filename to i even when i is
"stringified".
Regards,
Yannick