Date: 2004-08-10T21:53:41
   Editor: MichaelMcGrady <[EMAIL PROTECTED]>
   Wiki: Apache Struts Wiki
   Page: StrutsCatalogMultipleImageButtonsWithNoJavaScript
   URL: http://wiki.apache.org/struts/StrutsCatalogMultipleImageButtonsWithNoJavaScript

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -27,24 +27,12 @@
 
 {{{
 String command = ButtonCommand.getCommand(request);
-if (ButtonConstant.SUBMIT.equals(command)) {
+if ("submit".equals(command)) {
   // do whatever
 }
 }}}
 
-My !ButtonConstant class is equally simple.  You might have, for example:
-
-{{{
-public final class ButtonConstant {
-    public static final String CLEAR  = "clear";
-    public static final String DELETE = "delete";
-    public static final String SUBMIT = "submit";
-  private ButtonConstant() {
-  }
-}
-}}}
-
-This solution does not need to use the !ButtonConstant class or any other particular 
logic.  Most importantly, there is very, very little overhead either in footprint or 
in calculations with this solutions.  A vastly inferior, but more typical solution 
follows.
+Most importantly, there is very, very little overhead either in footprint or in 
calculations with this solution.  A vastly inferior, but more typical solution follows.
 
 SOLUTION TWO: THE TYPICAL BUT INFERIOR SOLUTION TYPE.
 
@@ -113,7 +101,7 @@
 }}}
 
 
-In the Action class, we check out which button type has been pressed as follows:
+Somewhere in the model, wherever we want to employ our logic, we check out which 
button type has been pressed as follows:
 
 {{{
   String command = buttonForm.getCommand();
@@ -126,7 +114,7 @@
   }
 }}}
 
-Enjoy!  And, thanks, Larry, for spurring me on to better ideas!  Namaste!
+Enjoy!  And, thanks, Larry Young, for spurring me on to better ideas!  Namaste!
 
 -- Michael !McGrady
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to