Re: [Zope] objectValues Question

2001-01-03 Thread Rik Hoekstra


I'm new to Zope and while 'playing' around I wondered about the following:

I've created a DTML method (called MyListFiles) that lists the 'File'
objects contained in a folder:

Now when I create a DTML document and call this method like this:



it produces no output.


Because DTML Documents are object of their own and DTML Methods are not.
THis means that if you are trying to get the 'objectValues' from the DTML
Method it will get them from the containing object, a Folder. If you try to
get them from a DTML Document, it will not return anything, as the DTML
Document holds no other objects. The solutions is to make the DTML Method
call its parent's (=containing object) objectValues. For example (untested):





Rik


___
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] objectValues Question

2001-01-03 Thread Cornelis J. de Brabander

By applying your MyListFiles method within the context of your DTML Document
you are asking for files that are contained by your DTML Document and there
are none. By 'viewing' your method in the management interface you are
applying your method within the context of the folder that contains it, and
that folder apparently contains file's. If you want to use your method
within a DTML Document with the very same result you could use for instance:



See also:
http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo

Cornelis J. de Brabander
==
Department of Education, Leiden University
P.O.Box 9555, NL-2300 RB Leiden
+31 71 527 3422/3401
[EMAIL PROTECTED]
==

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Koch
> Marc
> Sent: woensdag 3 januari 2001 12:16
> To: '[EMAIL PROTECTED]'
> Subject: [Zope] objectValues Question
>
>
> Hi,
>
> I'm new to Zope and while 'playing' around I wondered about the following:
>
> I've created a DTML method (called MyListFiles) that lists the 'File'
> objects contained in a folder:
>
> 
> This works as expected when I run it using the 'View' tab.
>
> Now when I create a DTML document and call this method like this:
>
> 
>
> it produces no output.
>
> Why?
>
>
> Thank You for any help
>
> -
>
> Un courrier électronique n'engage pas son émetteur. Tout message
> susceptible de comporter un engagement doit être confirmé par un
> écrit dûment signé.
>
> An electronic message is not binding on its sender. Any message
> referring to a binding engagement must be confirmed in writing
> and duly signed.
>
> Ein elektronischer Brief bzw. eine elektronische Nachricht ist
> für den Absender nicht verbindlich. Jede Nachricht,  welche eine
> Verpflichtung beinhaltet, muß schriftlich bestätigt und
> ordnungsgemäß unterzeichnet werden.
>
> -
>
>
>
> ___
> 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 )
>
>



___
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 )