struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Implementing "cancel" on a form
Date Mon, 05 Oct 2015 06:13:51 GMT
2015-10-04 20:32 GMT+02:00 Christopher Schultz <chris@christopherschultz.net>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> All,
>
> I've got a form which works nicely, and I'd like to add a "cancel"
> button to it. Right now, I have an Action class that implements no
> Struts2-defined interfaces... I just have the typical execute-style
> methods edit() and save(). I'd like to call cancel() when the user
> presses the cancel button.
>
> I've been both reading "Struts 2 in Action" and doing a bit of
> Googling, but it's tough to find resources on implementing "cancel".
>
> I did see something about using a button with a name like
> "redirect-action:index" but it wasn't clear when that redirection
> takes place... before or after the action is invoked.
>
> What am I missing?

You can use DMI (you must enable it first) and then you can use one of
those solution

https://struts.apache.org/docs/html-form-buttons-howto.html
https://struts.apache.org/docs/multiple-submit-buttons.html

basically:
<s:submit method="cancel" value="Cancel"/>


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message