[Zope] How do you replace content with an action?

Alexis Roda alexis.roda at urv.es
Thu Sep 2 12:15:51 EDT 2004


Laura McCord wrote:
> I need to be able to replace the content of a defined variable with an
> action. That action is by clicking a link that will redefine the
> variable with different content.

My english is not very good and possibly I don't understand what you're 
trying to do.

A TAL variable is a server side element while a click on a link is a 
client side event, and HTTP is a request/response protocol. When you 
click on a link there are no TAL variables, they have been destroyed 
when the page template processing has finished, so you can't change them 
from the client. However you can change the way the page template 
behaves (the values of the TAL variables) the next time a request is 
performed by adding something to the request that makes it "different" 
(a query_string parameter, a cookie ...).

Try adding a parameter to the link. In the page template check if the 
parameter has been submitted, if not show view_pc_sql results, if yes 
show view_sortSysName. Here you should be careful when creating the 
batch links, they must include the parameter when required in order to 
show the next/previous results from the same query.

Probably there are simpler solutions depending on what you're trying to do.




HTH
-- 
                                    ////
                                   (@ @)
----------------------------oOO----(_)----OOo--------------------------
<>               Ojo por ojo y el mundo acabara ciego
/\ Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
-----------------------------------------------------------------------



More information about the Zope mailing list