I have a DTML method C which is called from another DTML method B, itself called from a DTML method A. I set a variable, call it X, in the namespace of A with a <dtml-let, and another variable, call it Y, is set with a <dtml-let in B. Both are visible in C (Thanks for the help there, Dieter...) The body of C is a <dtml-in that references the SQL method and then, in the form's body, renders the returned rows in an apropriate fashion. The query itself is paramterized by X and Y, the parameters appearing in the query in <dtml-sqltest tags. The query works from the test framework.
From the diagonstic reports I get when I publish the page, the parameter values set in methods B and A do not appear to be available in the SQL query even though they are available in C's namespace. (In formulating the query method, the name X and Y appear as parameters.)
-dra
Dennis Allison writes:
I have a DTML method C which is called from another DTML method B, itself called from a DTML method A. I set a variable, call it X, in the namespace of A with a <dtml-let, and another variable, call it Y, is set with a <dtml-let in B. Both are visible in C (Thanks for the help there, Dieter...)
The body of C is a <dtml-in that references the SQL method and then, in the form's body, renders the returned rows in an apropriate fashion. Note that ZSQL methods do not look into the DTML namespace for arguments.
Either (exclusive) use "REQUEST.set" to pass arguments via REQUEST or use named parameters to pass all you Z SQL arguments. Surely, this is covered in the Zope book! Dieter
Dieter, Your dispatcher product looks perfect for one of my applications. I've downloaded it and installed it, but am having a bit of trouble getting it to work. An example in the docs might have helped... In my testbed to test the product, I have a single form with 3 text fieldsi implemented as a DTML method, basically three HTML input statments wrapped in a form with a submit button. The form's action references the dispatcher. I call the form "forma" and the dispatcher "doform". I have a python script, formadesc, that returns a list of dictionaries, one per form variable giving name, initial value, fixed, permananent, and dtype per the documentation. Everything else is left to default. I created a Session Data Manager object called FSSession. The bindings of forma and formadesc and FSSession are done throuygh the manage interface. Using the doform is the dispatcher instance, <dtml-var expr="doform.new()"> should create new object (forma instance) and render it. <dtml-var expr="doform.edit()" renders the form with filled-in values from the current session, <dtml-var expr="doform.update()" whereas update renders the form with saved values or new values with new values taking precedence. <dtml_call expr="doform.__call__()"> is used to save variables in the session object and then dispatch to an object with the format (.*)__disp(.[x]])? found somewhere in the form. (A bit more explantion and and example would help here....) Is my understanding of how to use the product correct? I think I am missing something fundamental as the small example I put together fails with an attribute error in _setup. -d
Dennis Allison writes:
... The bindings of forma and formadesc and FSSession are done throuygh the manage interface.
Using the doform is the dispatcher instance,
<dtml-var expr="doform.new()">
should create new object (forma instance) and render it.
<dtml-var expr="doform.edit()"
renders the form with filled-in values from the current session,
<dtml-var expr="doform.update()" Note, please, that you are allowed to call this method only, when you return to the dispatcher after you have made a "dispatch out" (i.e. "__call__").
whereas update renders the form with saved values or new values with new values taking precedence.
<dtml_call expr="doform.__call__()">
is used to save variables in the session object and then dispatch to an object with the format (.*)__disp(.[x]])? found somewhere in the form. (A bit more explantion and and example would help here....) This is very similar to Zope's ":method".
The "xxx__disp" is either the name of a button (more precisely, input type=submit) or a hidden variable, then usually in the form "__disp" with the value specifying the destination. With the "__disp", you specify the destination page that should be rendered when the variables are saved.
Is my understanding of how to use the product correct? Mostly (see the "update" remark above). I think I am missing something fundamental as the small example I put together fails with an attribute error in _setup. Maybe a bug or an incompatibility with your session product?
You know, how you should report errors? Error Type, Error Value and traceback are necessary information to say anything about a problem. I will be away for several weeks and thanks to lots of email ads, my mailbox will probably run out of quota. Thus, be patient and submit the additional information in about 3 to 4 weeks. Dieter
participants (2)
-
Dennis Allison -
Dieter Maurer