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

Dieter Fischer dieter.fischer@grid-it.ch
Tue, 22 Jul 2003 16:52:56 +0200


Hello David

Please reply to the list. In Zope.org a reply will not go the list, you have
to make a reply all (and then delete the sender, so he doesn't get the mail
twice).

I was also experementing a lot with formulator, unfortunately, the
documentation is not always so clear :-( , but it's open source :-)

> The reason I used :string instead of :int as you suggested is

Make it an :int! I don't think, it works without.

When you have a list as you put in your example:

ABC, 1
DEF, 2
HIJ, 3

I really don't understang why not.

> This is my Python function that builds the list:
> ----------------------------------------------------
> #Return a list of staff
> ...

I always use Z SQL Methods. I have in the TALES tab in ITEMS something like:

python:sql.language_codes_sql_py()

where I call:

for sql in container.sql.language_codes_sql(code=code):
...

The first is a python script which calls the Z SQL Method (all in a folder
sql). Unfortunately I wasn't able to call a Z SQL Method directly in the
TALES/ITEM. Either it's a bug or my lack of knowledge.

The reason why I'm using Z SQL Method is, that I've got all my SQL stuff
together (I like that, I'm an RDBMS man).

> Here is the question -- in the Formulator widget definition form, you can
> set three different values as DEFAULT:
>
> 1) PROPERTIES DEFAULT
> 2) TALES DEFAULT
> 3) OVERRIDE DEFAULT

1. This is o.k. when you're sure, the values are not changing. I put all the
stuff at least in a code table ( because the values alway *will* change
;-) )

2. This is the good place

3. Have you noticed, that formulator installs a help? When you're in the ZMI
and press the help in the upper right corner, a help window with a help
topic for formulator is opening:
There you find "Formulator Field - Override":

Note: the Override tab is being phased out in favor of the TALES tab.

> The TALES default value needs to be a TAL statement. I am unsure how to
> reference (the syntax) a value in a variable (company_contact_id_selected)
> as a TAL statement. I would like to load the data value from the hidden
> field above -- which I called "company_contact_id_selected:string". Do you
> know the proper TAL syntax? In the one example I found it requires
> PYTHON:...

see above

Regards

Dieter