[Zope-dev] Re: "Dispatch" argument solving submit button problem

Johan Carlsson [EasyPublisher] johanc@easypublisher.com
Tue, 15 Apr 2003 07:49:30 +0000


At 17:16 2003-04-14 -0500, Evan Simpson said:
>Johan Carlsson [EasyPublisher] wrote:
>><form method="dispatcher_url">
>><input type="submit" name="do_this:dispatcher" value=" Do This ">
>></form>
>>would add REQUEST['dispatcher']='do_this'
>
>Icky Hacky:
>
><input type="submit" name="dispatcher.do_this:record" value=" Do This ">
><input type="submit" name="dispatcher.do_that:record" value=" Do This ">
>
>...then:
>
>target = dispatcher.keys()[0]


I could run in to trouble if someone accidently adds a
<input name="dispatcher.unknown_stuff:record">
because keys()[0] wouldn't necessary be the method.

Of course my suggestion has a similar problem, but the
result of dispatcher would be a list if there is more than
one dispatcher field other than.

I tested how the method/action works and it executes
the last field (having an :method or :action).

Best Regards,
Johan Carlsson


-- 
Easy Publisher Developers Team
Johan Carlsson
johanc@easypublisher.com

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Phone +46-(0)8-31 24 94
Fax +46-(0)8-673 04 44
Mobil +46-(0)70-558 25 24
http://www.easypublisher.com