|
This is an alternative to the Action class that allows you to do
event based actions. Essentially, you label all your submit buttons
with the prefix of "eventSubmit_" and the suffix of "methodName".
For example, "eventSubmit_doDelete". Then any class that subclasses
this class will get its "doDelete(RunData data)" method executed.
If for any reason, it was not able to execute the method, it will
fall back to executing the doPeform() method which is required to
be implemented.
Limitations:
Because ParameterParser makes all the key values lowercase, we have
to do some work to format the string into a method name. For
example, a button name eventSubmit_doDelete gets converted into
eventsubmit_dodelete. Thus, we need to form some sort of naming
convention so that dodelete can be turned into doDelete.
Thus, the convention is this:
- The variable name MUST have the prefix "eventSubmit_".
- The variable name after the prefix MUST begin with the letters
"do".
- The first letter after the "do" will be capitalized and the
rest will be lowercase
If you follow these conventions, then you should be ok with your
method naming in your Action class.
author: Jon S. Stevens author: Henning P. Schmiedehausen author: Quinton McCombs version: $Id: ActionEvent.java 534527 2007-05-02 16:10:59Z tv $ |