[Zope] Formulator--pre-selecting a line in a multiline field

David Washburn dwashburn@aminfo.com
Mon, 21 Jul 2003 15:50:19 -0400


Dear Dieter,

Thank you for answering my Formulator question. I am a little unclear on
your answer.

If I may I would like to ask it more clearly.

In a DTML document, I have the following code to render the field
"company_contact_id" which is an integer, and its label, inside a table for
formatting:

<tr>
  <td><dtml-var "profile_form.company_contact_id.get_value('title')"></td>
  <td><dtml-var
"profile_form.company_contact_id.render(_['company_contact_id'])"></td>
</tr>

In this case, the field in the database is called "company_contact_id", and
that is also what I named it in Formulator.

In your example you said:

<INPUT TYPE="HIDDEN" NAME="sex_code:int" VALUE="<dtml-var sex_code
null="">">

I have read the database record before I display the page and I have the
values in the record, I am able to display other "fixed" fields.

I am not sure how your example fits with pre-setting the Formulator field on
display. In other Formulator fields, including the database field name as
(_['company_contact_id']) works to preview the value from the database
record. But in the case of the list field, it does not work.

Are you suggesting that I should create a hidden field and assign it the
value I want to select -- and then refer to that hidden field as the default
value of the Formulator multiline widget? Does the Formulator rendering code
understand how to do that with a multilist field?

Thanks for your help.

David

=======================================
David T. Washburn DWashburn@AmInfo.com
Amherst, MA USA
413 256-3103