[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'>
                tblStaffResearchers
                <dtml-else>tblStaffManagement
                </dtml-if>

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
parameter.

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
again EMPTY SPACES! 


I would need a proper statement that would embedd just fine in my drop-down
code:
<dtml-in expr="....">
   <option> <dtml-var sequence-item>
</dtml-in></select>&nbsp;</td>


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

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