Point taken about javascript, I agree, but balance that evil (and the fact that you're pushing a small amount of controller logic into your view) against the code bloat you get from having a bunch of classes to do the specific branching logic.
Tough call. I'll just try things out and see what I like best. Any other approaches out there? > Just add names to the form elements, i.e. > > <input type="submit" name="doSave" /> > <input type="submit" name="doCancel" /> > > And then add setters in your action: setDoSave() and setDoCancel(). > > In the doExecute() method, branch logic depending on which value was > set. > > Depending on JavaScript generally is a bad thing IMHO. > > Regards, > Kirk Rasmussen > Lucasfilm Ltd. > >> -----Original Message----- >> From: Steve Conover [mailto:[EMAIL PROTECTED] >> Sent: Monday, March 10, 2003 2:05 PM >> To: Webwork >> Subject: [OS-webwork] "best practices" around forms with >> multiple submit >> buttons >> >> >> What's the recommended way of handling a situation where you >> have multiple >> form buttons? i.e. "Save" and "Cancel". There are probably >> many ways to >> approach this and I'd like to hear how people on this list handle it. >> >> One way might be to use javascript to change a hidden flag field, and >> submit to an action that redirects to the right place. >> >> Another might be to use javascript to actually change the action...I >> haven't tried that but my first impression is that might be >> the cleanest >> way. >> >> Any ideas/advice? >> >> Thanks, >> Steve >> >> >> >> >> ------------------------------------------------------- >> This sf.net email is sponsored by:ThinkGeek >> Welcome to geek heaven. >> http://thinkgeek.com/sf >> _______________________________________________ >> Opensymphony-webwork mailing list >> [EMAIL PROTECTED] >> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork >> > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork