Personal tools
You are here: Home Products PloneFormGen Documentation How-Tos Use an AT Vocabulary Manager Vocabulary in a Selection Field

Use an AT Vocabulary Manager Vocabulary in a Selection Field

This How-to applies to: Any version.

You may use a simple vocabulary from AT Vocabulary Manager to populate the options of a selection or multiple-selection form field.

This one's simple. In the Options Vocabulary field on the selection form field's [override] panel, just use something like:

python:here.portal_vocabularies.getVocabularyByName('testVocabulary').getVocabularyLines()

substituting your vocabulary's name for "testVocabulary".

This recipe assumes you've installed AT Vocabulary Manager and created a simple or sorted-simple vocabulary. You'll also need to have the rights to edit TALES fields.

enforceVocabulary=False

Posted by Michael Schreiber at Jun 05, 2007 02:59 PM
I have been working with dynamically populating a select field, which upon the selection of a specific field: "Custom (editable)" it changes the field to a string field which allows the user to input a custom value. This works fine, except that upon submitting the form the error: "Value 'whatever I entered' is not allowed for vocabulary of element FieldName." I went into the $INSTANCE_HOME/Products/PloneFormGen/content/fields.py and changed "enforceVocabulary=0" for both selection and string fields and reinstalled the product, but it still does not permit me to add additional vocabularies to the select field. Any thoughts?