[Zope] how: passing a list as a hidden variable from doc to doc
Heiko Stoermer
Heiko Stoermer <heiko.stoermer@innominate.de>
Fri, 05 May 2000 13:56:06 +0200
Hello Zopistas,
I've come across this problem, (which delays my whole project and upsets
my employer):
I have a Form that displays a list of files for deletion and a checkbox
for each file to select it:
<dtml-in "prjfolder.objectIds('File')" skip_unauthorized>
<input type=checkbox name=del_list value=<dtml-var sequence-item>>
[...]
Users can check the files they want to delete. They submit the form to
the next dtml-method, say "delete". all checked filenames are passed to
this method as a list object, e.g.: ['file1', 'file2', 'file3'].
If I pass this list object to manage_delObjects(del_list), everything
goes fine. The objects are deleted.
Logical flow:
select -> delete
BUT:
I have to ask the user if he really wants to delete the files.
Thus:
select -> ask -> delete
So I need to pass the list of filenames through that darn "ask"
document.
There I did something like:
<input type=hidden name=del_list:list value="<dtml-var
"REQUEST['del_list']">">
this renders to:
<input type=hidden name=del_list:list value="['file1', 'file2',
'file3']">
(Note: I did the :list type conversion. I also tried tokens, lines,
whatever...)
If the user chooses to delete, I finally call my delete document, which
is supposed to delete the files in the list.
but the call to manage_delObjects(del_list) fails with:
Error Value: ['file1', 'file2', 'file3'] does not exist
How do I pass a list object from one document to another? It always
somehow becomes a string, breaking everything. There must be a clean
way; I do not want to do string magic with split or so.
Anyone help me out, please.
thanks in advance,
Heiko
--
heiko.stoermer@innominate.de
innominate AG
networkingpeople
fon: +49.30.308806-0 fax: -77 web: http://innominate.de