Hi All, I must say that I have very hard time with both Scripts and Zclass. My problem is the context and the container proprties of a script inside a Zclass. If I understand well the context is an URL point of view, the object accessed through the web. The container is fixed, it's the object in the database, OK? Now what is the container in the case of a Zclass _instance_. When I test a script inside the zclass _definition_ the container.objectItems() returns correctly all the other methods of the definition. When I run the script inside an _instance_ of that zclass it returns nothing. So is an instance the same container of its zclass definition or something else? What I should want to do is to access the images inside a zclass definition from the script running in an _instance_ 'context' of that zclass. BTW some pointers explaining the hierarchy in both the URL point of view and the database point of view would be very welcomed :-) Thanks in advance, Cyril
Cyril Elkaim wrote:
Hi All,
I must say that I have very hard time with both Scripts and Zclass. My problem is the context and the container proprties of a script inside a Zclass.
If I understand well the context is an URL point of view, the object accessed through the web.
The container is fixed, it's the object in the database, OK?
Now what is the container in the case of a Zclass _instance_.
In this case, container is the ZClass instance. This is consistent with the object-oriented way of defining methods in a class definition, and using them bound to an instance of that class. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net
Thanks Steve,
In this case, container is the ZClass instance.
Understood, that was my conclusion and it's logical. One more question please :-) How can I access the methods definitions of the zclass from an instance ? I don't talk about calling them but getting an 'attribute' of the zclass knowing only its name at _runtime_ not _compile_ time? Thanks, Cyril
Cyril Elkaim wrote:
How can I access the methods definitions of the zclass from an instance ?
I don't talk about calling them but getting an 'attribute' of the zclass knowing only its name at _runtime_ not _compile_ time?
I don't entirely understand what you want to do. Calling a method on a ZClass instance involves getting the attribute that represents that method, then calling it. Get the object that represents the method, and do what you want with it. Can you give me a concrete example? -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net
participants (2)
-
Cyril Elkaim -
Steve Alexander