Enter button on forms with keel:command

Nathan Kontny <Nathan.Kontny-UgwZ4owrJFB8UrSeD/[email protected]> Mon, 14 Jun 2004 21:27:18 -0700
Newsgroups gmane.comp.java.keel.user
Message-ID <[email protected]>
I noticed bug 887181 in Sourceforge where hitting the enter button causes the
form to post without any values.  I don't really understand the solution and I
have only tried it in IE, but here is some website talking about a fix for this
(http://forums.devshed.com/t35386/s.html).  

Anyways,  I altered the CommandTag.java to do this, and its allowing me now to
hit the enter button on forms.  Here is the patch, let me know if this works
for you.  

-Nate
CommandTagPatch.txt (text/plain, 1 KB)
Index: CommandTag.java
===================================================================
RCS file: /cvsroot/keel/clnt-struts/src/java/org/keel/clients/struts/CommandTag.java,v
retrieving revision 1.8
diff -u -r1.8 CommandTag.java
--- CommandTag.java	23 Feb 2004 21:26:58 -0000	1.8
+++ CommandTag.java	15 Jun 2004 04:22:08 -0000
@@ -313,6 +313,15 @@
             results.append(prepareEventHandlers());
             results.append(prepareStyles());
             results.append(">");
+            
+            //Added this element so that the enter button works to submit the form
+            results.append("<input type=\"hidden\" name=\"");
+            results.append("COMMAND_" + commandName);
+            results.append("\"");
+            results.append(" value=\"");
+            results.append(commandLabel);
+            results.append("\"");
+            results.append(">\n");
 
             // Render this element to our writer
             ResponseUtils.write(pageContext, results.toString());