Personal tools
You are here: Home Products PloneFormGen Documentation FAQs Dynamically populate selection fields
Document Actions

Dynamically populate selection fields

Up to Table of Contents

This FAQ applies to: Any version.

Can I dynamically populate selection and/or multi-selection fields in PloneFormGen?

Yes, just use the [overrides] panel of the field's edit view to set an Options Vocabulary.

It should be a TALES expression that evaluates as a list of value/label lists (tuples are also OK).

For example, let's say that we wanted a selection field populated with option values '1', '2', '3', '4' and matching visible labels 'one', 'two', three', 'four'. The TALES code for this would be:

python: (('1','one'), ('2','two'), ('3','three'), ('4','four'))
It's unlikely, though, that you'll be able to do what you need in a single line of TALES. So, a more typical use would be to create a python script that returns a sequence of value/label sequences. If you put that script in your form folder, you can just fill in:
here/myscriptid

in your Options Vocabulary field.

by Steve McMahon last modified December 15, 2006 - 21:56

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by