My latest solution is very similar.  I name my submit buttons saveCommand,
cancelCommand, etc.  I have an ActionFactoryProxy that checks for a param
with name *Command.  If that exists, it parses the first part of the
command name ("save" or "cancel"), and adds a new param to the parameters
map named "command" with the parsed name as the value.  Finally, it
removes the *Command parameter from the parameter map.

Then I just use WW features - I have an Action class that extends
ActionSupport and implements CommandDriven, which has methods like doSave
and doCancel.

Which brings up a question about WW.  I have the ability to execute one of
many commands as described above, so should I be able to give each its own
treatment in the mapping file?

ex:
foo.action!save.success=someview.vm
foo.action!cancel.success=index.action

-Steve

> On Tue, Mar 11, 2003 at 05:04:42PM -0500, Rob Rudin wrote:
>> Ahh well, yes, that would be a good point... In the situation
>> on my current job, it's an intranet site and we have control
>> over the client workstations. If that's not the case, then yes,
>> frowning on javascript does make a lot sense.
>
> My way:
>
> Dispatch by the name (not value) of the submitted button. My Actions has
> a list of known submit button parameter names and dispatchers to a
> command depending on which known parameters in the list has a value set.
> This can be easily refactored in an abstract base class.
>
> Sadly, I have not simple source example at hand, but I think the idea is
> clear.
>
> -billy.
>
> --
> Meisterbohne   Meisterbohne GbR, Küfner,Mekle, Meier    Tel: +49-731-399
> 499-0
>    eLösungen   Söflinger Straße 100                     Fax: +49-731-399
> 499-9
>                89077 Ulm
> http://www.meisterbohne.de/





-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to