[Zope] reindex when a zclass is edited

Tim Hicks Tim Hicks" <tim@sitefusion.co.uk
Sat, 13 Jan 2001 15:41:01 -0000


----- Original Message -----
From: Aleksander Salwa <ololo@zeus.polsl.gliwice.pl>
To: Tim Hicks <tim@sitefusion.co.uk>
Cc: <zope@zope.org>
Sent: Friday, January 12, 2001 8:34 AM
Subject: Re: [Zope] reindex when a zclass is edited


>
> On Thu, 11 Jan 2001, Tim Hicks wrote:
>
> > 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?
>
> I use this code for that purpose:
>
> <dtml-if "REQUEST.has_key('dtpref_cols')">
>  <dtml-if "REQUEST.has_key('dtpref_rows')">
>   <dtml-var
> "manage_edit(data,title,SUBMIT,dtpref_cols,dtpref_rows,REQUEST)">
>  <dtml-else>
>   <dtml-var "manage_edit(data,title,SUBMIT,dtpref_cols,REQUEST=REQUEST)">
>  </dtml-if>
> <dtml-else>
>  <dtml-if "REQUEST.has_key('dtpref_rows')">
>   <dtml-var
> "manage_edit(data,title,SUBMIT,dtpref_rows=dtpref_rows,REQUEST=REQUEST)">
>  <dtml-else>
>   <dtml-var "manage_edit(data,title,SUBMIT,REQUEST=REQUEST)">
>  </dtml-if>
> </dtml-if>
> <dtml-call "reindex_object()">
> <dtml-call "RESPONSE.redirect(manage_edycjaTresciForm.absolute_url())">
>
>

Thanks very much for the help Aleksander, but when I drop your code into my
method, it doesn't work (it doesn't break either). I simply copied and
pasted your code, then edited the final redirect at the bottom.  Here is the
submission part of my edit form (if it makes any difference).

<TD align=left>
          <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Change">
 </TD>
 <TD align=left>
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Taller">
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Shorter">
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Wider">
   <INPUT NAME=SUBMIT TYPE="SUBMIT" VALUE="Narrower">
 </TD>

I had a look on the ZQR, and found the section on manage_edit, but I still
don't really understand how the dtpref_cols/rows works.  Any insight?

Cheers

tim