[Zope] Using Dieter's Dispatcher
Dennis Allison
allison@sumeru.stanford.EDU
Sun, 12 May 2002 18:16:07 -0700 (PDT)
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