[Zope-DB] Get value from selected item

Kerstin Petersen Kerstin.Petersen@giub.uni-bonn.de
Wed, 29 Jan 2003 12:51:55 +0100

this is probably a beginners question.

My question:

1. I created a database connection
2. a sql method (GetMitarbeiter) is called by a dtml method 
(Mitarbeiter) to display a list of empoyees.

<h1>Mitarbeiter </h1>

   <dtml-in GetMitarbeiter>
      <a href=MitarbeiterEmail>
      <dtml-var Titel> <dtml-var Vorname> <dtml-var Nachname>
   <dtml-var statusname>

SQL method GetMitarbeiter:
select MitarbeiterNr,Titel,Vorname,Nachname,StatusName
from Mitarbeiter,M_Status
where Mitarbeiter.status1=M_Status.statusNr order by MitarbeiterNr

DTML method MitarbeiterEmail:
   <dtml-in GetEmail>
       <li><dtml-var email>

argument: Mitarbeiter=1
select email from Mitarbeiter where
<dtml-sqltest MitarbeiterNr op=eq type=string>

3. in the dtml method object(Mitarbeiter) the names of the employees are 
referenced to an other dtml method object(MitarbeiterEmail) that calls 
an other sql method (GetEmail) to get the email from the selected employee.

My question: How can I get the value of the MitarbeiterId of the 
selected employee or write it to a variable instead of an input 
argument. I would like to use the result, that is dependend on the 
selected employee, in the sql method to get only the email of the 
selected employee.

Thank you for help