[Zope] retrieving a single column from database and giving it as hyper link fetching respective data
Thomas Bennett
bennetttm at appstate.edu
Fri Apr 11 09:55:59 EDT 2008
On Friday 11 April 2008 01:02, member madhangc wrote:
> Dear all,
>
> I'm developing a biological database using Zope 2.6 and pgsql. Let me
> explain my issue with an example. There is a menu called Drug in my
> homepage, by clicking the menu the drug names along with their type in two
> different columns get displayed in the body. I can do things till that. My
> problem is , lets say there is a link called "Isoniazid" with all other
> links(drug names) in it. When a user clicks one of the links as i said
> before as "isoniazid" only the information about isoniazid has to be
> retreived and displayed , likewise to all the other drug links. I have no
> idea how to capture the click event and the data to be retrieved. Can
> someone help. Thanks in advance.
From your description I can't tell if you are already populating the
two column page from a database or if it is a static html page. If
I understand your issue correctly you can do all this with your
database. You may have to add more columns to provide the
interaction you need.
I have a similar situation with a three column subjects page
where clicking on each subject brings up a page with a list of
online databases and descriptions for each. Within each
description is a link to the online database.
Again, if I understand your issue, have your two column page be
created from a db that contains the a record number and the drug
name. That template can build a link based on the record number
to another template and the second template would query the
database for a description field or whatever.
so the first page would build its contents sorta like this.
<dtml-in get_drug _names>
<a href="http:/link/to/my/description/template/?my_recnum=<dtml-var drug_name_recnum>"><dtml-var my_drug_name></a>
</dtml-in>
same thing can be done in pagetemplates. You can see my example at
http://www.library.appstate.edu/vdb/subjectgeneral05.html
The list of subjects comes from a database and there are three select
statements to make the three columns, select the first third, second third,
and then the last third and use css. Each subject link to another template
that selects data from the main table based on subject table's related field.
And, on that second page you can narrow down the results by media type
such as book, newspaper, audio, etc. which is a field in the database title
table.
Let me know if I misinterpreted your request, as I get older this becomes
more frequent ;-)
>
> And another query, how can i select text from a dropdown box. I just need
> the data which is selected in the dropdown box and sent as query.
>
> Thanks again.
If you click on a letter at the top you will see a list box on the right which uses
a javascript called jumpmenu and OnChange which should work or be close to
what you want. There is not an action attribute for the list box and no button, the
Javascript takes care of it.
Thomas
--
====================================================================
Thomas McMillan Grant Bennett Appalachian State University
Operations & Systems Analyst P O Box 32026
University Library Boone, North Carolina 28608
(828) 262 6587
"... using OpenOffice.org, and save them back to disk automatically,
in MS Word format. They surf the Web, check e-mail, do instant
messsaging, view YouTube videos, visit their Facebook pages, learn
touch-typing skills and lots more. Our public library has been
offering these Linux public stations for the past three years."
- Phil Shapiro Linux Journal January 2008
Library Systems Help Desk: https://www.library.appstate.edu/help/
====================================================================
More information about the Zope
mailing list