[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope
Subject:    Re: [Zope] properties of ZPT
From:       Dieter Maurer <dieter () handshake ! de>
Date:       2003-05-22 18:14:54
[Download RAW message or body]

Andreas Pakulat wrote at 2003-5-22 00:13 +0200:
 > I've got a small thing with ZPT here. My template got a property
 > "activetab", which represents the number of the active tab in the
 > template. This affects mainly the coloring of table headers. My problem
 > is how to change this property by clicking on a link within one of the
 > tabs?! My first thought was to use a script, but how do I tell the
 > script which tab/link was clicked on? Or can I directly change the
 > property by linking to the template?

Do not use a property for this!

  Which tab is active is *not* a property of the object
  but of the visit history.

  Encode the information in the URL or in a session.
  Look at the ZMI for an example (--> "App/dtml/manage_tabs.dtml")
  how to do this.

Coding "activeness" in the template has 2 serious drawbacks:

  *  visits by other persons change the object state, I see

  *  each visit causes the template to be written to the ZODB
     leading to unnecessary write operations (potential conflict
     errors) and an unnecessary ZODB growth.


Dieter

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic