I have a method in the root of my application called "getProxies" that queries a catalog for a given metatype. I have a folder in the root called "Platforms" with a method called "selectInstance" that renders a series of checkbox tags. I call "selectInstance" method from an adjacent folder with <dtml-with Platforms> <dtml-var selectInstance> </dtml-with> This is how this method look at first: <dtml-let control_set="setControl(_, 'PlatformID')" control_name="control_set[0]" control_value="control_set[1]" control_type="'checkbox'" num_columns="3"> <dtml-in getProxies('Platform') sort="Name" prefix="platform"> <dtml-let item="platform_item.id" display_item="platform_item.Name"> <dtml-var inputTag> </dtml-let> </dtml-in> </dtml-let> Doing the above gives a key error for "getProxies", however if I move "getProxies" into the let tag it does _not_: <dtml-let control_set="setControl(_, 'PlatformID')" control_name="control_set[0]" control_value="control_set[1]" control_type="'checkbox'" num_columns="3" proxies="getProxies('Platform')"> <dtml-in proxies sort="Name"> <dtml-let item="id" display_item="Name"> <dtml-var inputTag> </dtml-let> </dtml-in> </dtml-let> It seems like <dtml-let> is doing something with the namespace that makes it impossible for the subsequent <dtml-in> tag to find the "getProxies" method in the root. Any ideas why? -- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za
On Mon, 2002-05-27 at 11:45, Roché Compaan wrote:
[...]
<dtml-in getProxies('Platform') sort="Name" prefix="platform">
This is not a valid syntax, you should have:: <dtml-in "getProxies('Platform')" sort="Name" prefix="platform"> Note the double quotes around the getProxies call. In order not to use the double quotes, you'd have not to pass any parameters to getProxies as in: <dtml-in getProxies sort="Name" prefix="platform"> Cheers PS: please, do not crosspost. This kind of question is better of in the zope@zope.org list. This reply goes crossposted for completness sake. -- Ideas don't stay in some minds very long because they don't like solitary confinement.
On Mon, 2002-05-27 at 18:31, Leonardo Rochael Almeida wrote:
On Mon, 2002-05-27 at 11:45, Roché Compaan wrote:
[...]
<dtml-in getProxies('Platform') sort="Name" prefix="platform">
This is not a valid syntax, you should have::
<dtml-in "getProxies('Platform')" sort="Name" prefix="platform">
Note the double quotes around the getProxies call. In order not to use the double quotes, you'd have not to pass any parameters to getProxies as in:
<dtml-in getProxies sort="Name" prefix="platform">
Oopps, I think my eyes got really tired - I was refactoring about 200 methods. I must have known it is something like this becuase in some places it worked, hehe :) Apologies for the cross posting - I thought this was reeeealy interesting.
participants (2)
-
Leonardo Rochael Almeida -
Roché Compaan