Date: 2004-07-26T17:16:19
   Editor: MichaelMcGrady <[EMAIL PROTECTED]>
   Wiki: Apache Struts Wiki
   Page: StrutsCatalogMultipleImageButtonsWithNoJavaScript
   URL: http://wiki.apache.org/struts/StrutsCatalogMultipleImageButtonsWithNoJavaScript

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -13,37 +13,35 @@
 public class Button
     implements Serializable {
 
-  private Data cancel       = new Data("cancel");
-  private Data change       = new Data("change");
-  private Data clear        = new Data("clear");
-  private Data commitChange = new Data("commitChange");
-  private Data exit         = new Data("exit");
-  private Data reset        = new Data("reset");
-  private Data select       = new Data("select");
-  private Data submit       = new Data("submit");
+  private Operation cancel       = new Operation("cancel");
+  private Operation clear        = new Operation("clear");
+  private Operation commitChange = new Operation("commitChange");
+  private Operation exit         = new Operation("exit");
+  private Operation reset        = new Operation("reset");
+  private Operation select       = new Operation("select");
+  private Operation submit       = new Operation("submit");
 
   public Button() {}
-  public Data getCancel()       { return cancel; }
-  public Data getChange()       { return change; }
-  public Data getClear()        { return clear; }
-  public Data getCommitChange() { return commitChange; }
-  public Data getExit()         { return exit; }
-  public Data getReset()        { return reset; }
-  public Data getSelect()       { return select; }
-  public Data getSubmit()       { return submit; }
+  public Operation getCancel()       { return cancel; }
+  public Operation getClear()        { return clear; }
+  public Operation getCommitChange() { return commitChange; }
+  public Operation getExit()         { return exit; }
+  public Operation getReset()        { return reset; }
+  public Operation getSelect()       { return select; }
+  public Operation getSubmit()       { return submit; }
 
-  public class Data
+  public class Operation
       implements Serializable {
     private String  name;
     private Integer x, y;
 
-    public Data()                    { }
-    public Data(String name)         { this.name = name; }
+    public Operation()                    { }
+    public Operation(String name)         { this.name = name; }
     public void setName(String name) { this.name = name; }
     public void setX(Integer x)      { this.x = x; }
     public void setY(Integer y)      { this.y = y; }
     public boolean pressed()         { return (x != null || y != null); }
-    public String toString()         { return "Button.Data: name = " + name + " x = " 
+ x + " y = " + y; }
+    public String toString()         { return "Button.Operation: name = " + name + " 
x = " + x + " y = " + y; }
   }
 }
 }}}
@@ -97,7 +95,7 @@
 Again, alternative frameworks can use alternative but equivalent
 mechanisms for getting the data on the button type pressed.
 
-
+One last important matter.  The buttons are distinguished by what they do, not what 
they say.  You can have either "GO.gif" or "CLICK.gif" or "SUBMIT.gif" go with 
"button.submit" without changing the Action or !ActionForm classes.  And,  a new 
operation will require a change only in the Action class, not in the !ActionForm class.
 
 Enjoy!  Namaste!
 

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

Reply via email to