[Zope] select_question

Dieter Maurer dieter@handshake.de
Tue, 26 Jun 2001 05:34:41 +0200 (CEST)


Kathrin Deubrecht writes:
 > I have a folder 'project' with some subfolders (the projects). The subfolders 
 > have different properties.
 > 
 > Now I created a form in which I can include new properties for a new subfolder. 
 > A DTML-method called 'project_prozessor' adds this new subfolder with its new 
 > properties to folder 'project'.
 > 
 > Now my problem :
 > 
 > I want to create a selection list with all my subfolders from folder 'project' 
 > and when I click on a subfolder, the properties which belong to my selected 
 > folder should be in the parts of the form , now.
 > 
 > How can I generate my side with the form new?
You use "<dtml-in objectValues>" in a DTML Method (!)

or better:

	<dtml-with project>
	  <dtml-in objectValues>
	   ...
	  </dtml-in>
	</dtml-with>

to generate the "select"'s option list.

The action activated by submitting your selection form,
will render your property form. To access
the subproject's properties, it will look like:

    <dtml-with "_.getitem(selectedSubproject)">
      ....
      <input name="PROPERTY" value="&dtml-PROPERTY;">
      ....
    </dtml-with>

This assumes that the "select"'s name in the selection form
is "selectedSubproject" and you want to access a property
named "PROPERTY".


It seems that some background reading may help you.
Look for the Zope book or

  URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html




Dieter