[Zope] reindex when a zclass is edited

Tim Hicks Tim Hicks" <tim@sitefusion.co.uk
Thu, 11 Jan 2001 21:51:05 -0000


----- Original Message -----
From: Ivan Cornell <ivan.cornell@framestore.co.uk>
To: Tim Hicks <tim@sitefusion.co.uk>
Cc: <zope@zope.org>
Sent: Wednesday, January 10, 2001 7:53 PM
Subject: Re: [Zope] reindex when a zclass is edited


> Tim Hicks wrote:
>
> >  I can't for the
> > life of me figure out or find anywhere that can tell me how to make the
> > instance get reindexed when it is edited.  I'm assuming that it is
similar
> > to the process for reindexing when the properties are changed, but I'm
just
> > not sure of the details. If it's not too much trouble, could someone
give me
> > detailed instructions (or a link) on how to do this. I'd really
appreciate
> > it.
> >
>
> In your method which is called by your edit form, insert a <dtml-call
> "this().reindex_object()"> after updating the properties.
>
> Eg, in my manage_edit method I have
>
>     <dtml-call "propertysheets.Base.manage_editProperties(REQUEST)">
>     <dtml-call "propertysheets.Facility.manage_editProperties(REQUEST)">
>     <dtml-call "this().reindex_object()">
>
> Regards, Ivan
>
>

Much obliged Ivan, I have managed to do it now.  I ended up creating
my_editForm and my_edit methods within the zclass and then using the source
from a builtin edit form as my template.  One thing doesn't work now though,
and that's making the textarea wider/narrow/etc.  Obviously, this is because
I have static values put in for the dimensions of the text area, but I'm not
sure how to alter this to make it work... any pointers?
my_edit looks like this btw,

<html><body>
<dtml-call "manage_edit(data, REQUEST.title)">
<dtml-call reindex_object>
<dtml-call "RESPONSE.redirect(absolute_url()+'/my_editForm')">
</body></html>

Does this seem appropriate?

cheers

tim