[Zope] help with manage_renameObjects
Passin, Tom
tpassin at mitretek.org
Mon Sep 15 16:49:41 EDT 2003
[grissom at qwickconnect.net]
> Here is my method rename2:
> <dtml-call "manage_renameObjects(ids=[oldlid],
> new_ids=[newid])">
> <dtml-call "RESPONSE.redirect('deleteForm2')">
>
> and here is the form that calls it deleteform2:
> <form action="<!--#var URL0-->" method="POST"
> enctype="multipart/form-data">
> <dtml-in "objectValues(['File'])">
> <input class="form-element" type="text" name="<dtml-var
> id>" size="40" value=" <dtml-var id> "><br>
>
> </dtml-in>
> <input type=hidden name="ids:tokens:default">
> <input class="form-element" type="submit"
> name="rename2:method" value=" Save Changes "/>
> </form>
>
> When I submit the form I get the following:
> Error Type: NameError
> Error Value: global name 'oldlid' is not defined
You need to have a form variable named "oldid", and you can reference it
as REQUEST.oldid. Similarly for newID. You can arrange that by calling
each of the form elements by the same name, "oldid:list" (and similarly
for newid, of course). You only need to add ":list" in case you might
one time have only one, because it would be returned as a string instead
of a list.
Then in your method rename2, you would not use brackets to make oldid a
list, because it already is one.
BTW, you might as well get rid of the old syntax and write
<form action="<dtml-var URL0>"
It is odd to see the old !--# and the new dtml- mixed together.
Cheers,
Tom P
More information about the Zope
mailing list