Problem with Properties and Methods
Hi, I think again a simple quuestion. In a dtml-document I am calling a dtml-method from a subdirectory <dtml-var "directory.method()"> In the subdirectory the method is looking like: <td colspan=3 bgcolor="<dtml-var color_number>"> color_number is a property in the root directory - with type string and value "#eeeecc" If I test the method directly with view it works correctly If I call it in the document from the rootdirectory I get the following error ---------------------------------------------------------------------------- Error Type: KeyError Error Value: color_number Troubleshooting Suggestions This resource may be trying to reference a nonexistent object or variable color_number. The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience --------------------------------------------------------------------------- What am I doing wrong? Should I better use a dtml-method on in the root directory or why should I use properties? Thanks Borno -- Sent through Global Message Exchange - http://www.gmx.net
On Sat, 5 Feb 2000, Borno Janekovic wrote:
In a dtml-document I am calling a dtml-method from a subdirectory <dtml-var "directory.method()">
By calling the method without parameters you loose the namespace. There are 2 (two) ways to overcome: 1. Use <dtml-with>: <dtml-with directory> <dtml-var method> </dtml-with directory> 2. Pass the namespace: <dtml-var "directory.method(_.None, _)"> Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
Borno Janekovic -
Oleg Broytmann