Closed joaomatossilva closed 11 years ago
I like where your going with this, its a cool idea. I am not sure force extra implementation in every action is a good convention, it seems like more code and more work, when what I am shooting for is more simplicity. I could see putting something like this in a global action filter, and then you get the best of both worlds.
I agree that the cancel button should have a reasonable default implementation, because now the cancel button submits the form (at least in some browsers), requiring additional code in the controller.
I "solved" this in my pull request by rendering a cancel button as an anchor (using Html.ActionLink(...)
) that is styled as a button, using TB styling. It's not a great solution, but doesn't require any additional coding in the controllers and provides a reasonable default implementation.
I merged the other pull request.. I think this one needs some more design, before we can accept server side processing for a cancel.
i just merged it.
Eric Hexter
blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter
On Wed, Nov 28, 2012 at 3:15 PM, Marijn van der Zee < notifications@github.com> wrote:
I agree that the cancel button should have a reasonable default implementation, because now the cancel button submits the form (at least in some browsers), requiring additional code in the controller.
I "solved" this in my pull requesthttps://github.com/erichexter/twitter.bootstrap.mvc/pull/19by rendering a cancel button as an anchor (using Html.ActionLink(...)) that is styled as a button. It's not a great solution, but doesn't require any additional coding in the controllers and provides a reasonable default implementations.
— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/pull/13#issuecomment-10822006.
I agree. I was also reluctant for the server side. I only did go that route because of the info warning showing the cancel action.
If cancel should submit or not, it should be a per scenario action, for rolling back or other actions. Most of the cases it is as simple as a link like @serra did.
Here's an example of the cancel button implementation. After this, I could totally use on my day to day basis an html extension for a cancel button, and some mechanic on the controller to apply the cancel logic. Probably an actionfilter similar like HttpGet and HttpPost for the same action name.