[Zope] Filling a drop-down menu with SQL data (Problem with ar gument passing)

philipp.robbel@epost.de philipp.robbel@epost.de
Wed, 23 May 2001 14:41:29 +0100

Hello everybody,

I have been trying and trying the whole day but I still have not found any
solution to my (simple?) problem:
=> I want to fill my HTML DropDown menu with data from a SQL table.

My SQL Method (sqlShowTypes) takes one argument which I have defined in
the Z SQL Method Properties as "TypeName". The function is as follows:

SELECT Typ FROM <dtml-if expr="TypeName=='Researcher'>

When testing this method seperatly from the calling dtml document it works
fine. After specifing a TypeName Parameter it returns all the rows from
the Typ-column.

Now, in my DTML Document I have a Variable "Typ" (either containing 'Researcher'
or 'Management'). This one I want to pass to sqlShowTypes as the TypeName

My first try was:
<dtml-in expr="sqlShowTypes('<dtml-var Typ>')">  : not working (Bad Request,
Error Value: ['Typname'])

2nd try:
<dtml-in expr="sqlShowTypes(TypName='<dtml-var Typ>')">   : somehow working
but my drop-down menu is filled with 5 empty spaces!

3rd try:
<dtml-in expr="sqlShowTypes(TypName=Typ)"   : again, somehow working but

I would need a proper statement that would embedd just fine in my drop-down
<dtml-in expr="....">
   <option> <dtml-var sequence-item>

If you are that Zope Guru I'm so badly in need of, please help me with that

PS.: "sequence-item" is the proper one to use in the code above, right?

Thanks a lot,
Philipp Robbel

Der clevere Infobote - Shopping-Tipps bequem abonniert. Jetzt neu bei http://www.epost.de