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

List:       zope
Subject:    Re: [Zope] properties of ZPT
From:       Andreas Pakulat <ap125 () informatik ! uni-rostock ! de>
Date:       2003-05-22 20:26:09
[Download RAW message or body]

On 22.Mai 2003 - 20:14:54, Dieter Maurer wrote:
> 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.

That's right, came to my mind, as I saw my page template this morning.
I think I was a bit blind about that.

Andreas

-- 
Try to value useful qualities in one who loves you.

[Attachment #3 (application/pgp-signature)]
_______________________________________________
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