Author: hlship
Date: Wed Jan  6 18:42:39 2010
New Revision: 896611

URL: http://svn.apache.org/viewvc?rev=896611&view=rev
Log:
TAP5-947: Default name "submit" for submit component breaks javascript function 
submit()

Modified:
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java?rev=896611&r1=896610&r2=896611&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
 Wed Jan  6 18:42:39 2010
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -291,7 +291,15 @@
 
         name = renderSupport.allocateClientId(resources);
 
-        formSupport = createRenderTimeFormSupport(name, actionSink, new 
IdAllocator());
+        // Pre-register some names, to prevent client-side collisions with 
function names
+        // attached to the JS Form object.
+        
+        IdAllocator allocator = new IdAllocator();
+        
+        allocator.allocateId("reset");
+        allocator.allocateId("submit");
+        
+        formSupport = createRenderTimeFormSupport(name, actionSink, allocator);
 
         if (zone != null)
             clientBehaviorSupport.linkZone(name, zone, link);


Reply via email to