[Zope] properties of ZPT
Thu, 22 May 2003 20:14:54 +0200
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.