Author: ivaynberg
Date: Tue Nov 14 23:57:36 2006
New Revision: 475147

URL: http://svn.apache.org/viewvc?view=rev&rev=475147
Log:
backport WICKET-64

Added:
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/Check.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/CheckGroup.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/Radio.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/RadioGroup.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/util/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/util/tester/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/util/tester/FormTester.java
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/
    incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTest.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTest.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html
Modified:
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Check.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/CheckGroup.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Radio.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/RadioGroup.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/util/tester/FormTester.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTest.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTest.java
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html
    
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Check.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Check.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Check.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Check.java
 Tue Nov 14 23:57:36 2006
@@ -45,6 +45,11 @@
 
        private static final String ATTR_DISABLED = "disabled";
 
+       /**
+        * page-scoped uuid of this check. this property must not be accessed
+        * directly, instead [EMAIL PROTECTED] #getValue()} must be used
+        */
+       private short uuid = -1;
 
        /**
         * @see WebMarkupContainer#WebMarkupContainer(String)
@@ -64,6 +69,23 @@
 
 
        /**
+        * Form submission value used for this radio component. This string will
+        * appear as the value of the <code>value</code> html attribute for the
+        * <code>input</code> tag.
+        * 
+        * @return form submission value
+        */
+       public final String getValue()
+       {
+               if (uuid < 0)
+               {
+                       uuid = getPage().getAutoIndex();
+               }
+               return "check" + uuid;
+       }
+
+
+       /**
         * @see Component#onComponentTag(ComponentTag)
         * @param tag
         *            the abstraction representing html tag of this component
@@ -78,20 +100,17 @@
                checkComponentTagAttribute(tag, "type", "checkbox");
 
                CheckGroup group = (CheckGroup)findParent(CheckGroup.class);
-               String path = getPath();
                if (group == null)
                {
-                       throw new WicketRuntimeException(
-                                       "Check component ["
-                                                       + path
-                                                       + "] cannot find its 
parent CheckGroup. All Check components must be a child of or below in the 
hierarchy of a CheckGroup component.");
+                       throw new WicketRuntimeException("Check component [" + 
getPath()
+                                       + "] cannot find its parent 
CheckGroup");
                }
 
-               String relativePath = path.substring(group.getPath().length() + 
1);
-                       
+               final String uuid = getValue();
+
                // assign name and value
                tag.put("name", group.getInputName());
-               tag.put("value", relativePath);
+               tag.put("value", uuid);
 
                // check if the model collection of the group contains the 
model object.
                // if it does check the check box.
@@ -108,10 +127,14 @@
 
                if (group.hasRawInput())
                {
-                       String rawInput = group.getRawInput();
-                       if (rawInput != null && rawInput.indexOf(relativePath) 
!= -1)
+                       final String[] input = group.getInputAsArray();
+
+                       for (int i = 0; i < input.length; i++)
                        {
-                               tag.put("checked", "checked");
+                               if (uuid.equals(input[i]))
+                               {
+                                       tag.put("checked", "checked");
+                               }
                        }
                }
                else if (collection.contains(getModelObject()))
@@ -145,6 +168,5 @@
 
 
        }
-
 
 }

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/CheckGroup.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/CheckGroup.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/CheckGroup.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/CheckGroup.java
 Tue Nov 14 23:57:36 2006
@@ -19,9 +19,11 @@
 
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
+import wicket.Component;
 import wicket.WicketRuntimeException;
 import wicket.markup.html.WebMarkupContainer;
 import wicket.model.IModel;
@@ -99,7 +101,7 @@
        /**
         * @see wicket.markup.html.form.FormComponent#convertValue(String[])
         */
-       protected Object convertValue(String[] paths) throws ConversionException
+       protected Object convertValue(String[] values) throws 
ConversionException
        {
                List collection = new ArrayList();
 
@@ -108,27 +110,42 @@
                 * collection has already been cleared
                 */
 
-               if (paths != null && paths.length > 0)
+               if (values != null && values.length > 0)
                {
-                       for (int i = 0; i < paths.length; i++)
+                       for (int i = 0; i < values.length; i++)
                        {
-                               String path = paths[i];
+                               final String value = values[i];
 
-                               if (path != null)
+                               if (value != null)
                                {
-                                       // retrieve the selected checkbox 
component
-                                       Check checkbox = (Check)get(path);
+                                       Check checkbox = 
(Check)visitChildren(new Component.IVisitor()
+                                       {
+
+                                               public Object 
component(Component component)
+                                               {
+                                                       if (component 
instanceof Check)
+                                                       {
+                                                               final Check 
check = (Check)component;
+                                                               if 
(String.valueOf(check.getValue()).equals(value))
+                                                               {
+                                                                       return 
check;
+                                                               }
+                                                       }
+                                                       return 
CONTINUE_TRAVERSAL;
+                                               }
+
+                                       });
 
                                        if (checkbox == null)
                                        {
                                                throw new 
WicketRuntimeException(
                                                                "submitted http 
post value ["
-                                                                               
+ paths.toString()
+                                                                               
+ Arrays.toString(values)
                                                                                
+ "] for CheckGroup component ["
                                                                                
+ getPath()
                                                                                
+ "] contains an illegal relative path "
                                                                                
+ "element ["
-                                                                               
+ path
+                                                                               
+ value
                                                                                
+ "] which does not point to a Check component. Due to this the CheckGroup 
component cannot resolve the selected Check component pointed to by the illegal 
value. A possible reason is that componment hierarchy changed between rendering 
and form submission.");
                                        }
 

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Radio.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Radio.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Radio.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/Radio.java
 Tue Nov 14 23:57:36 2006
@@ -25,7 +25,8 @@
 import wicket.util.lang.Objects;
 
 /**
- * Component representing a single radio choice in a 
wicket.markup.html.form.RadioGroup.
+ * Component representing a single radio choice in a
+ * wicket.markup.html.form.RadioGroup.
  * 
  * Must be attached to an &lt;input type=&quot;radio&quot; ... &gt; markup.
  * 
@@ -45,6 +46,12 @@
 
 
        /**
+        * page-scoped uuid of this check. this property must not be accessed
+        * directly, instead [EMAIL PROTECTED] #getValue()} must be used
+        */
+       private short uuid = -1;
+
+       /**
         * @see WebMarkupContainer#WebMarkupContainer(String)
         */
        public Radio(String id)
@@ -62,6 +69,23 @@
 
 
        /**
+        * Form submission value used for this radio component. This string will
+        * appear as the value of the <code>value</code> html attribute for the
+        * <code>input</code> tag.
+        * 
+        * @return form submission value
+        */
+       public final String getValue()
+       {
+               if (uuid < 0)
+               {
+                       uuid = getPage().getAutoIndex();
+               }
+               return "radio" + uuid;
+       }
+
+
+       /**
         * @see Component#onComponentTag(ComponentTag)
         * @param tag
         *            the abstraction representing html tag of this component
@@ -75,28 +99,28 @@
                checkComponentTag(tag, "input");
                checkComponentTagAttribute(tag, "type", "radio");
 
+               final String value = getValue();
+
                RadioGroup group = (RadioGroup)findParent(RadioGroup.class);
-               String path = getPath();
                if (group == null)
                {
                        throw new WicketRuntimeException(
                                        "Radio component ["
-                                                       + path
+                                                       + getPath()
                                                        + "] cannot find its 
parent RadioGroup. All Radio components must be a child of or below in the 
hierarchy of a RadioGroup component.");
                }
 
-               String relativePath = path.substring(group.getPath().length() + 
1);
-               
+
                // assign name and value
                tag.put("name", group.getInputName());
-               tag.put("value", relativePath);
+               tag.put("value", value);
 
                // compare the model objects of the group and self, if the same 
add the
                // checked attribute, first check if there was a raw input on 
the group.
-               if(group.hasRawInput())
+               if (group.hasRawInput())
                {
                        String rawInput = group.getRawInput();
-                       if(rawInput != null && rawInput.equals(relativePath))
+                       if (rawInput != null && rawInput.equals(value))
                        {
                                tag.put("checked", "checked");
                        }
@@ -114,18 +138,20 @@
                        Form form = (Form)group.findParent(Form.class);
                        if (form != null)
                        {
-                               tag.put("onclick", 
form.getJsForInterfaceUrl(url) );
+                               tag.put("onclick", 
form.getJsForInterfaceUrl(url));
                        }
                        else
                        {
-                               // NOTE: do not encode the url as that would 
give invalid JavaScript
+                               // NOTE: do not encode the url as that would 
give invalid
+                               // JavaScript
                                tag.put("onclick", "window.location.href='" + 
url + "&" + group.getInputName()
                                                + "=' + this.value;");
                        }
                }
-               
-               
-               if (!isActionAuthorized(ENABLE) || !isEnabled() || 
!group.isEnabled()) {
+
+
+               if (!isActionAuthorized(ENABLE) || !isEnabled() || 
!group.isEnabled())
+               {
                        tag.put(ATTR_DISABLED, ATTR_DISABLED);
                }
        }

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/RadioGroup.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/RadioGroup.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/RadioGroup.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/markup/html/form/RadioGroup.java
 Tue Nov 14 23:57:36 2006
@@ -17,6 +17,7 @@
  */
 package wicket.markup.html.form;
 
+import wicket.Component;
 import wicket.WicketRuntimeException;
 import wicket.markup.html.WebMarkupContainer;
 import wicket.model.IModel;
@@ -31,13 +32,13 @@
  * ie
  * 
  * <pre>
- *  &lt;span wicket:id=&quot;radiochoicegroup&quot;&gt;
- *    ...
- *    &lt;input type=&quot;radio&quot; 
wicket:id=&quot;singleradiochoice1&quot;&gt;choice 1&lt;/input&gt;
- *    ...
- *    &lt;input type=&quot;radio&quot; 
wicket:id=&quot;singleradiochoice2&quot;&gt;choice 2&lt;/input&gt;
- *    ...
- *  &lt;/span&gt;
+ *      &lt;span wicket:id=&quot;radiochoicegroup&quot;&gt;
+ *        ...
+ *        &lt;input type=&quot;radio&quot; 
wicket:id=&quot;singleradiochoice1&quot;&gt;choice 1&lt;/input&gt;
+ *        ...
+ *        &lt;input type=&quot;radio&quot; 
wicket:id=&quot;singleradiochoice2&quot;&gt;choice 2&lt;/input&gt;
+ *        ...
+ *      &lt;/span&gt;
  * </pre>
  * 
  * @author Igor Vaynberg ([EMAIL PROTECTED])
@@ -78,16 +79,29 @@
        {
                if (input != null && input.length > 0)
                {
-                       String path = input[0];
+                       final String value = input[0];
+                       Radio choice = (Radio)visitChildren(new 
Component.IVisitor()
+                       {
 
-                       // retrieve the selected single radio choice component
-                       Radio choice = (Radio)get(path);
+                               public Object component(Component component)
+                               {
+                                       if (component instanceof Radio)
+                                       {
+                                               final Radio radio = 
(Radio)component;
+                                               if 
(radio.getValue().equals(value))
+                                               {
+                                                       return radio;
+                                               }
+                                       }
+                                       return CONTINUE_TRAVERSAL;
+                               }
 
+                       });
                        if (choice == null)
                        {
                                throw new WicketRuntimeException(
                                                "submitted http post value ["
-                                                               + path
+                                                               + value
                                                                + "] for 
RadioGroup component ["
                                                                + getPath()
                                                                + "] is illegal 
because it does not contain relative path to a Radio componnet. "

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/util/tester/FormTester.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/util/tester/FormTester.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/util/tester/FormTester.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/util/tester/FormTester.java
 Tue Nov 14 23:57:36 2006
@@ -419,10 +419,7 @@
                                        Assert.fail("RadioGroup " + 
formComponent.getPath() + " does not has index:"
                                                        + index);
                                }
-                String path=foundRadio.getPath();
-                path=path.substring(formComponent.getPath().length()+1, 
path.length());
-                
-                               assignValueToFormComponent(formComponent, path);
+                               assignValueToFormComponent(formComponent, 
foundRadio.getValue());
                        }
                        else if (formComponent instanceof CheckGroup)
                        {
@@ -433,11 +430,9 @@
                                        Assert.fail("CheckGroup " + 
formComponent.getPath() + " does not have index:"
                                                        + index);
                                }
-                               
-                               String path=foundCheck.getPath();
-                               
path=path.substring(formComponent.getPath().length()+1, path.length());
-                               
-                               assignValueToFormComponent(formComponent, path);
+
+
+                               assignValueToFormComponent(formComponent, 
String.valueOf(foundCheck.getValue()));
                        }
                        else
                        {

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html
 Tue Nov 14 23:57:36 2006
@@ -1,14 +1,14 @@
-<html>
-<head><title>CheckGroupTestPage1</title></head>
-<body>
-    <!--  In addition test that chars are not converted from upper to lower 
and vice versa -->
-       <FORM 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
-               <span disabled="disabled" wicket:id="group" name="group">
-                       <Input value="check1" type="checkbox" 
disabled="disabled" wicket:id="check1" checked="checked" 
name="group">check1</input>
-                       <span wicket:id="container">
-                               <input value="container:check2" type="checkbox" 
disabled="disabled" wicket:id="check2" checked="checked" 
name="group">check2</input>
-                       </span>
-               </span>
-       </FORM>
-</body>
-</html>
+<html>
+<head><title>CheckGroupTestPage1</title></head>
+<body>
+    <!--  In addition test that chars are not converted from upper to lower 
and vice versa -->
+       <FORM 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
+               <span disabled="disabled" wicket:id="group" name="group">
+                       <Input value="check0" type="checkbox" 
disabled="disabled" wicket:id="check1" checked="checked" 
name="group">check1</input>
+                       <span wicket:id="container">
+                               <input value="check1" type="checkbox" 
disabled="disabled" wicket:id="check2" checked="checked" 
name="group">check2</input>
+                       </span>
+               </span>
+       </FORM>
+</body>
+</html>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTest.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTest.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTest.java
 Tue Nov 14 23:57:36 2006
@@ -155,20 +155,24 @@
                assertTrue("running with nothing selected - model must be 
empty", modelObject.getProp1()
                                .size() == 0);
 
-               
application.getServletRequest().setParameter(group.getInputName(), 
"container:check1");
+               
application.getServletRequest().setParameter(group.getInputName(),
+                               String.valueOf(choice1.getValue()));
                form.onFormSubmitted();
                assertTrue("running with choice1 selected - model must only 
contain value of check1",
                                modelObject.getProp1().size() == 1 && 
modelObject.getProp1().contains(check1));
 
-               
application.getServletRequest().setParameter(group.getInputName(), "prop2");
+               
application.getServletRequest().setParameter(group.getInputName(),
+                               String.valueOf(choice2.getValue()));
                form.onFormSubmitted();
                assertTrue("running with choice2 selected - model must only 
contain value of check2",
                                modelObject.getProp1().size() == 1 && 
modelObject.getProp1().contains(check2));
 
                // throw in some nulls into the request param to make sure they 
are
                // ignored
-               
application.getServletRequest().getParameterMap().put(group.getInputName(),
-                               new String[] { null, "container:check1", null, 
"prop2" });
+               application.getServletRequest().getParameterMap().put(
+                               group.getInputName(),
+                               new String[] { null, 
String.valueOf(choice1.getValue()), null,
+                                               
String.valueOf(choice2.getValue()) });
                form.onFormSubmitted();
                assertTrue(
                                "running with choice1 and choice2 selected - 
model must only contain values of check1 and check2",
@@ -176,7 +180,7 @@
                                                && 
modelObject.getProp1().contains(check1));
 
                
application.getServletRequest().getParameterMap().put(group.getInputName(),
-                               new String[] { "some weird path to test error" 
});
+                               new String[] { "some weird choice uuid to test 
error" });
                try
                {
                        form.onFormSubmitted();
@@ -216,11 +220,11 @@
 
                }
        }
-       
+
        /**
         * @throws Exception
         */
-       public void testDisabledCheckGroup()  throws Exception
+       public void testDisabledCheckGroup() throws Exception
        {
                executeTest(CheckGroupDisabledTestPage.class, 
"CheckGroupDisabledTestPage_expected.html");
        }

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html
 Tue Nov 14 23:57:36 2006
@@ -4,9 +4,9 @@
     <!--  In addition test that chars are not converted from upper to lower 
and vice versa -->
        <FORM 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
                
-                       <Input value="check1" type="checkbox" 
wicket:id="check1" name="group">check1</input>
+                       <Input value="check0" type="checkbox" 
wicket:id="check1" name="group">check1</input>
                        <span wicket:id="container">
-                               <input value="container:check2" type="checkbox" 
wicket:id="check2" name="group">check2</input>
+                               <input value="check1" type="checkbox" 
wicket:id="check2" name="group">check2</input>
                        </span>
                
        </FORM>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html
 Tue Nov 14 23:57:36 2006
@@ -3,9 +3,9 @@
 <body>
        <form 
action="/WicketTester/WicketTester?wicket:interface=:1:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
                
-                       <input value="check1" type="checkbox" 
wicket:id="check1" checked="checked" name="group">check1</input>
+                       <input value="check0" type="checkbox" 
wicket:id="check1" checked="checked" name="group">check1</input>
                        <span wicket:id="container">
-                               <input value="container:check2" type="checkbox" 
wicket:id="check2" name="group">check2</input>
+                               <input value="check1" type="checkbox" 
wicket:id="check2" name="group">check2</input>
                        </span>
                
        </form>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html
 Tue Nov 14 23:57:36 2006
@@ -3,9 +3,9 @@
 <body>
        <form 
action="/WicketTester/WicketTester?wicket:interface=:2:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
                
-                       <input value="check1" type="checkbox" 
wicket:id="check1" name="group">check1</input>
+                       <input value="check0" type="checkbox" 
wicket:id="check1" name="group">check1</input>
                        <span wicket:id="container">
-                               <input value="container:check2" type="checkbox" 
wicket:id="check2" checked="checked" name="group">check2</input>
+                               <input value="check1" type="checkbox" 
wicket:id="check2" checked="checked" name="group">check2</input>
                        </span>
                
        </form>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html
 Tue Nov 14 23:57:36 2006
@@ -3,9 +3,9 @@
 <body>
        <form 
action="/WicketTester/WicketTester?wicket:interface=:3:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
                
-                       <input value="check1" type="checkbox" 
wicket:id="check1" checked="checked" name="group">check1</input>
+                       <input value="check0" type="checkbox" 
wicket:id="check1" checked="checked" name="group">check1</input>
                        <span wicket:id="container">
-                               <input value="container:check2" type="checkbox" 
wicket:id="check2" checked="checked" name="group">check2</input>
+                               <input value="check1" type="checkbox" 
wicket:id="check2" checked="checked" name="group">check2</input>
                        </span>
                
        </form>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html
 Tue Nov 14 23:57:36 2006
@@ -1,13 +1,13 @@
-<html>
-<head><title>RadioGroupTestPage1</title></head>
-<body>
-       <form 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
-               <span disabled="disabled" wicket:id="group" name="group">
-                       <input value="radio1" type="radio" disabled="disabled" 
wicket:id="radio1" name="group">radio1</input>
-                       <span wicket:id="container">
-                               <input value="container:radio2" type="radio" 
disabled="disabled" wicket:id="radio2" checked="checked" 
name="group">radio2</input>
-                       </span>
-               </span>
-       </form>
-</body>
-</html>
+<html>
+<head><title>RadioGroupTestPage1</title></head>
+<body>
+       <form 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
+               <span disabled="disabled" wicket:id="group" name="group">
+                       <input value="radio0" type="radio" disabled="disabled" 
wicket:id="radio1" name="group">radio1</input>
+                       <span wicket:id="container">
+                               <input value="radio1" type="radio" 
disabled="disabled" wicket:id="radio2" checked="checked" 
name="group">radio2</input>
+                       </span>
+               </span>
+       </form>
+</body>
+</html>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTest.java?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTest.java
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTest.java
 Tue Nov 14 23:57:36 2006
@@ -146,8 +146,8 @@
                assertTrue("group2: running with nothing selected - model must 
be set to null", model
                                .getObject(null) == null);
 
-               
application.getServletRequest().setParameter(group.getInputName(), 
choice1.getPath().substring(group.getPath().length() + 1));
-               
application.getServletRequest().setParameter(group2.getInputName(), 
choice3.getPath().substring(group2.getPath().length() + 1));
+               
application.getServletRequest().setParameter(group.getInputName(), 
choice1.getValue());
+               
application.getServletRequest().setParameter(group2.getInputName(), 
choice3.getValue());
                form.onFormSubmitted();
                assertEquals("group: running with choice1 selected - model must 
be set to value of radio1",
                                modelObject.getProp1(), 
choice1.getModelObject());
@@ -155,12 +155,12 @@
                                "group2: running with choice3 selected - model 
must be set to value of radio1",
                                model.getObject(null), 
choice3.getModelObject());
 
-               
application.getServletRequest().setParameter(group.getInputName(), 
choice2.getPath().substring(group.getPath().length() + 1));
+               
application.getServletRequest().setParameter(group.getInputName(), 
choice2.getValue());
                form.onFormSubmitted();
                assertEquals("group: running with choice2 selected - model must 
be set to value of radio2",
                                modelObject.getProp1(), 
choice2.getModelObject());
 
-               
application.getServletRequest().setParameter(group2.getInputName(), 
choice1.getPath().substring(group.getPath().length() + 1));
+               
application.getServletRequest().setParameter(group2.getInputName(), 
choice1.getValue());
                try
                {
                        form.onFormSubmitted();

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html
 Tue Nov 14 23:57:36 2006
@@ -3,9 +3,9 @@
 <body>
        <form 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
                
-                       <input value="radio1" type="radio" wicket:id="radio1" 
name="group">radio1</input>
+                       <input value="radio0" type="radio" wicket:id="radio1" 
name="group">radio1</input>
                        <span wicket:id="container">
-                               <input value="container:radio2" type="radio" 
wicket:id="radio2" checked="checked" name="group">radio2</input>
+                               <input value="radio1" type="radio" 
wicket:id="radio2" checked="checked" name="group">radio2</input>
                        </span>
                
        </form>

Modified: 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html?view=diff&rev=475147&r1=475146&r2=475147
==============================================================================
--- 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html
 (original)
+++ 
incubator/wicket/branches/wicket-1.2.x/wicket/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html
 Tue Nov 14 23:57:36 2006
@@ -1,10 +1,10 @@
-<html>
-<body>
-<form 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
-       
-               <input value="check1" type="radio" wicket:id="check1" 
checked="checked" name="radio">Yes
-               <input value="check2" type="radio" wicket:id="check2" 
checked="checked" name="radio">No
-       
-</form>
-</body>
+<html>
+<body>
+<form 
action="/WicketTester/WicketTester?wicket:interface=:0:form::IFormSubmitListener"
 wicket:id="form" method="post" id="form"><div style="display:none"><input 
type="hidden" name="form:hf:0" id="form:hf:0" /></div>
+       
+               <input value="radio0" type="radio" wicket:id="check1" 
checked="checked" name="radio">Yes
+               <input value="radio1" type="radio" wicket:id="check2" 
checked="checked" name="radio">No
+       
+</form>
+</body>
 </html>

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/Check.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/Check.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/CheckGroup.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/CheckGroup.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/Radio.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/Radio.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/RadioGroup.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/markup/html/form/RadioGroup.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/util/tester/FormTester.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/main/java/wicket/util/tester/FormTester.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupDisabledTestPage_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTest.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage1_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage2_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage3_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/CheckGroupTestPage4_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupDisabledTestPage_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTest.java?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTestPage1_expected.html?view=auto&rev=475147
==============================================================================
    (empty)

Added: 
incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket/ws/wicket-1.2.x/src/test/java/wicket/markup/html/form/RadioGroupTestPage3_expected.html?view=auto&rev=475147
==============================================================================
    (empty)


Reply via email to