[Zope] Converting a string into an object?

Tommy Johnson tommy@7x.com
Tue, 10 Jul 2001 18:26:21 -0800


Hey, here's a situation.

services (folder)
  |
  |- editable (folder)
  |    |
  |    |- annual (folder)
  |        |
  |        |- Editable_body (method)
  |    |
  |    |- register (folder)
  |        |
  |        |- Editable_body (method)
  |
  |- admin (folder)
       |
       |- Admin_selectSection (method)
       |- Admin_editContent (method)

Admin_selectSection contains a form that asks a user what section they want
to edit.
<form action="Admin_editContent">
Select a section to edit: <br><br>

<select name="sectionId" size="1">
    <dtml-with editable>
        <dtml-in objectValues>
            <option value="<dtml-var id>"><dtml-var title></option>
        </dtml-in>
    </dtml-with>
</select> <br><br>

<input type="submit" name="submit" value=" Edit this Section ">
</form>


Now, Admin_editContent receives this info and should build a form that shows
the title and text of the Editable_body method. This should function pretty
much like the ZMI. The problem is that I can't seem to access the
Editable_body method. In fact, if I were to put in:
    <dtml-in objectValues><dtml-var id><br></dtml-in>

I get a list of the folders inside 'editable', and NOT what I expected - a
list of what is contained within the folder 'annual'. ( or 'register' -
depending on which was selected previously). If I were to print out the form
variable:
    <dtml-var expr="REQUEST.form['sectionId']">
I get 'annual', but it's a string. So, I guess I need to convert it to an
object BEFORE my objectValues will work?? And, if that is the case, how do I
do that? Is there some sort of restore method that I could use?

The second form is included below, just in case you wanna see it for
somethin'

<dtml-with editable>

    <dtml-with expr="REQUEST.form['sectionId']">
        <form action="Admin_action">
        Title: <input name="title" size="20">
        <br><br>
        <textarea name="txtContent" cols="40" rows="7"
wrap="virtual"></textarea>
        <br><br>

        <input type="submit" name="submit" value=" Save Changes ">
        </form>
    </dtml-with>

</dtml-with>


Sorry for the novel, and thanks in advance,
Tommy

Innovation:
The Best Way To Predict The Future ...
     Is To Create It.