Author: knopp
Date: Fri Jul 27 16:54:43 2007
New Revision: 560427

URL: http://svn.apache.org/viewvc?view=rev&rev=560427
Log:
The form may not try to get id from markup file

Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java?view=diff&rev=560427&r1=560426&r2=560427
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/Form.java
 Fri Jul 27 16:54:43 2007
@@ -326,6 +326,7 @@
        public Form(final String id)
        {
                super(id);
+               setOutputMarkupId(true);
        }
 
        /**
@@ -338,6 +339,7 @@
        public Form(final String id, IModel model)
        {
                super(id, model);
+               setOutputMarkupId(true);
        }
 
        /**
@@ -1308,19 +1310,14 @@
 
        /**
         * Returns the javascript/css id of this form that will be used to 
generated
-        * the id="xxx" attribute. it will be generated if not set already in 
the
-        * onComponentTag. Where it will be tried to load from the markup first
-        * before it is generated.
+        * the id="xxx" attribute. 
         * 
         * @return The javascript/css id of this form.
+        * @deprecated use [EMAIL PROTECTED] #getMarkupId()}
         */
        protected final String getJavascriptId()
        {
-               if (Strings.isEmpty(javascriptId))
-               {
-                       javascriptId = getMarkupId();
-               }
-               return javascriptId;
+               return getMarkupId();
        }
 
 
@@ -1485,24 +1482,6 @@
                super.onComponentTag(tag);
 
                checkComponentTag(tag, "form");
-
-               // If the javascriptid is already generated then use that on 
even it
-               // was before the first render. Because there could be a 
component
-               // which already uses it to submit the forum. This should be 
fixed
-               // when we pre parse the markup so that we know the id is at 
front.
-               if (!Strings.isEmpty(javascriptId))
-               {
-                       tag.put("id", javascriptId);
-               }
-               else
-               {
-                       javascriptId = (String)tag.getAttributes().get("id");
-                       if (Strings.isEmpty(javascriptId))
-                       {
-                               javascriptId = getJavascriptId();
-                               tag.put("id", javascriptId);
-                       }
-               }
 
                if (isRootForm())
                {


Reply via email to