Re: [Zope] reindex when a zclass is edited

2001-01-14 Thread Aleksander Salwa

On Sat, 13 Jan 2001, Tim Hicks wrote:

 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?

It uses cookies (named 'dtpref_rows' and 'dtpref_cols') storing size of
your textarea. Have you turned off cookies by accident ?
If it receives (from edit form) a variable named 'SUBMIT' with value equal
to one of the above ('Taller', etc.), then it sends new cookie values to
the browser.

Source file: lib/python/OFS/DTMLMethod.py,
methods 'manage_edit' and '_er'.


[EMAIL PROTECTED], [EMAIL PROTECTED]

/--\
| `long long long' is too long for GCC |
\--/


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] reindex when a zclass is edited

2001-01-13 Thread Tim Hicks


- Original Message -
From: Aleksander Salwa [EMAIL PROTECTED]
To: Tim Hicks [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
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


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] reindex when a zclass is edited

2001-01-12 Thread Aleksander Salwa


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())"


[EMAIL PROTECTED], [EMAIL PROTECTED]

/--\
| `long long long' is too long for GCC |
\--/


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] reindex when a zclass is edited

2001-01-11 Thread Tim Hicks


- Original Message -
From: Ivan Cornell [EMAIL PROTECTED]
To: Tim Hicks [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
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,

htmlbody
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


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] reindex when a zclass is edited

2001-01-10 Thread Ivan Cornell

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



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )