Ok,
I have no idea how to implement this right now, but it might be pretty cool
to try to implement...one of you can figure out how to do it and add it to
Turbine...:-)
How about adding the option to have event based form submission. In other
words, when your Action is called, it receives an "event" depending on which
button was clicked that had the type="submit". We could come up with a bean
style naming convention so that all you need to do is implement the methods
in your Action.
For example:
Say you have this html:
<input type="submit" name="submit_Delete" value="Delete">
Then, when your Action is called, Turbine would then loop through all the
Parameters looking for the name="submit_*" and then parse that and attempt
to execute the "void doDelete(RunData data)" method in your Action which
would then handle the action of that button. If that method doesn't exist,
then it would default to some sort of other method such as the doPerform()
method.
There are a few benefits to this:
#1. You don't have pull data out of the ParameterParser to check to see
which button is clicked.
#2. You don't have to have an if tree that goes through to performs the
button action depending on which button came out of ParameterParser.
I can't think of any negatives other than some potentially duplicated code
for pulling the data out of the ParameterParser and storing it.
What do you guys think about this idea? If you like it, I will add it to the
TODO list and hope that someone here will want to implement it. If you don't
do it, I will do it at some later date cause I think it is a good idea. :-)
thanks,
-jon
--
Java Servlet Based - Open Source | Collab.Net
Bug/Issue Tracking System |
<http://scarab.tigris.org/> | <http://Collab.Net/jobs/>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]