On the one hand, using _action_Foo_ eliminates the need to map button
titles to method names. On the other hand, this means that Page must always
for key in self.request().fields().keys():
# handle action
e.g., every request requires the construction of keys() and a linear search
through them to determine if this request is using the "action feature".
Mandatory linear searches scare me.
It's actually a bummer. I wish <input type=submit> had a "title=" argument.
I guess we could avoid the linear search if we tapped into the translation
of the query string to a dictionary. I don't know how easy that is; we're
using the cgi module.
At 07:27 PM 12/15/2000 +0100, Paul Boddie wrote:
>I was just reading the documentation for actions and it says...
> "Add buttons to your HTML form of type submit and name _action_."
>Further on, there is the comment...
> "Unfortunately, the HTML submit button does not separate it's [sic]
> value from it's [sic] title/label. If your button labels don't match
> your method names, you will need to implement methodNameForAction() to
> provide the mapping."
>Isn't this really awkward for things like localisation? Wouldn't it be
>incorporate the logical action name into the name of the field itself, so that
>if you really wanted to keep the distinctive "look" of the name, it might
>bit like this:
> <input name=_action_New_ type=submit value=New>
> <input name=_action_Delete_ type=submit value=Delete>
> <input name=_action_New_ type=submit value=Nouveau>
> <input name=_action_Delete_ type=submit value=Supprimer>
> <input name=_action_New_ type=submit value=Ny>
> <input name=_action_Delete_ type=submit value=Slett>
>What do you think?
>P.S. I didn't think of this when I was writing my XForms test...
>Webware-discuss mailing list