problem with selection list in ZClass's addForm
Property Degree in my ZClass is of type "selection", getting its choices from the root folder property DegreeTypes. DegreeTypes is of type "lines" and has choices ['B.Sc.','M.Sc.','Ph.D.']. My problem is that the user's choice is not getting set properly by the class's constructor. The following is the relevent snippet from my addForm: <SELECT NAME="Degree"><dtml-in DegreeTypes> <OPTION VALUE="<dtml-var sequence-index>"><dtml-var sequence-item></OPTION> </dtml-in></SELECT> I've looked at the REQUEST variable being passed from the form and it is an integer corresponding correctly to the index of the selected Degree. I have tried casting this to string and to int but to no avail - it always defaults to the first element of DegreeTypes. (I can subsequently set it to any of the 3 choices in the intance's Properties sheet.) What am I missing? Darran.
----- Original Message ----- From: "Darran Edmundson" <Darran.Edmundson@anu.edu.au> To: "zope" <zope@zope.org> Sent: Sunday, February 06, 2000 9:45 AM Subject: [Zope] problem with selection list in ZClass's addForm
My problem is that the user's choice is not getting set properly by the class's constructor. The following is the relevent snippet from my addForm:
<SELECT NAME="Degree"><dtml-in DegreeTypes> <OPTION VALUE="<dtml-var sequence-index>"><dtml-var sequence-item></OPTION> </dtml-in></SELECT>
The way I've done this, which I think is similar to how Zope's propertysheet stuff does it is like this: <option value="<dtml-var sequence-index>"<dtml-if "Degree == _['sequence-index']"> selected</dtml-if>> Everything else you've got is the same... just change that option tag... Kevin
participants (2)
-
Darran Edmundson -
Kevin Dangoor