[Zope] properties of ZPT

Andreas Pakulat ap125@informatik.uni-rostock.de
Thu, 22 May 2003 22:26:09 +0200


--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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?
>=20
> Do not use a property for this!
>=20
>   Which tab is active is *not* a property of the object
>   but of the visit history.
>=20
>   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.
>=20
> Coding "activeness" in the template has 2 serious drawbacks:
>=20
>   *  visits by other persons change the object state, I see
>=20
>   *  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

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

--9amGYk9869ThD9tj
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+zTJhuekl0h+nrMIRAohyAJ9biU0OiC9j8nL/49nxn86o/9SMnACeNiqU
RWF76ENk2kLLJWuB5F+9kPI=
=YAMl
-----END PGP SIGNATURE-----

--9amGYk9869ThD9tj--