RE: [Zope] Passing arguments with hyperlinks
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
I have a ZSQL Method that takes an argument (teamid). I want to pass this argument using a hyperlink. The idea is to click on a Firm's name and be taken to a detail that includes all the team members for that project. The data all comes from an existing Access database. All I need is the teamid, but obviously it is different for each row. I was thinking <a href="<dtml-var ProjTeamMembers teamid=<dtml-var FirmTeamID>"><dtml-var FirmName></a>. But I don't think this will work. ProjTeamMembers is the dtml Method that calls the ZSQL method using a <dtml-in>. What is the proper approach to this problem? Is there a good way to store a bunch of info about rows returned from a ZSQL Query. I've briefly heard of pluggable brains,but....
Hi Michael, You can create links like this: <a href="ProjTeamMembers?teamid=&dtml-FirmTeamId;"><dtml-var FirmName></a> When you click on it, ProjTeamMembers will be run with the variable 'teamid' in the namespace. When you call your ZSQL method, you just pass it the argument, as in: <dtml-in expr="myZSQLMethod(teamid=teamid)"> ...display team member... </dtml-in> This should give you what you're looking. You don't need pluggable brians for this. _______________________ Ron Bickers Logic Etc, Inc.
<a href="ProjTeamMembers?teamid=&dtml-FirmTeamId;"><dtml-var FirmName></a>
or in the "old" but sometimes easier to understand syntax: <a href="ProjTeamMembers?teamid=<dtml-var FirmTeamId>"><dtml-var FirmName></a> If you have more than one parameter, put it like this: http://url?parameterX=1¶meterY=2¶meterZ=3
When you click on it, ProjTeamMembers will be run with the variable 'teamid' in the namespace. When you call your ZSQL method, you just pass it the argument, as in:
<dtml-in expr="myZSQLMethod(teamid=teamid)"> ...display team member... </dtml-in>
Even easier: <dtml-in myZSQLMethod> The namespace-passing stuff all works automatically as long as you have "teamid" in the parameter list of the ZSQL method ... Joachim
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Joachim Werner
<dtml-in expr="myZSQLMethod(teamid=teamid)"> ...display team member... </dtml-in>
Even easier: <dtml-in myZSQLMethod>
The namespace-passing stuff all works automatically as long as you have "teamid" in the parameter list of the ZSQL method ...
That would make sense, but I seem to recall having problems with this in the past. Maybe I'm thinking of some other case. _______________________ Ron Bickers Logic Etc, Inc.
participants (3)
-
Joachim Werner -
Ron Bickers -
Ron Bickers