Author: jdonnerstag
Date: Sun Sep 23 07:31:15 2007
New Revision: 578574

URL: http://svn.apache.org/viewvc?rev=578574&view=rev
Log:
wicket-993: wicket:enclosure doesn't work with multiple child components

fixed

Added:
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePageExpectedResult_2.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.html
   (with props)
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.java
   (with props)
Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java?rev=578574&r1=578573&r2=578574&view=diff
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
 Sun Sep 23 07:31:15 2007
@@ -18,6 +18,7 @@
 
 import org.apache.wicket.Component;
 import org.apache.wicket.MarkupContainer;
+import org.apache.wicket.Response;
 import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.MarkupException;
@@ -25,6 +26,7 @@
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.parser.filter.EnclosureHandler;
 import org.apache.wicket.markup.resolver.EnclosureResolver;
+import org.apache.wicket.response.NullResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -168,7 +170,16 @@
                }
                else
                {
-                       markupStream.skipUntil(openTag.getName());
+                       Response response = getResponse();
+                       
getRequestCycle().setResponse(NullResponse.getInstance());
+                       try
+                       {
+                               super.onComponentTagBody(markupStream, openTag);
+                       }
+                       finally
+                       {
+                               getRequestCycle().setResponse(response);
+                       }
                }
        }
 }

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePageExpectedResult_2.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePageExpectedResult_2.html?rev=578574&view=auto
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePageExpectedResult_2.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePageExpectedResult_2.html
 Sun Sep 23 07:31:15 2007
@@ -0,0 +1,10 @@
+<html xmlns:wicket>
+<body>
+<div wicket:id="example3">
+    <h3>Example 3 using wicket:enclosure</h3>
+    <span wicket:id="label1">label 1</span><br />
+    <span wicket:id="label2">label 2</span><br />
+    <wicket:enclosure child="label3"></wicket:enclosure>
+</div>
+</body>
+</html>

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePageExpectedResult_2.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.html?rev=578574&view=auto
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.html
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.html
 Sun Sep 23 07:31:15 2007
@@ -0,0 +1,13 @@
+<html xmlns:wicket>
+<body>
+<div wicket:id="example3">
+    <h3>Example 3 using wicket:enclosure</h3>
+    <span wicket:id="label1"></span><br />
+    <span wicket:id="label2"></span><br />
+    <wicket:enclosure child="label3">
+        <span wicket:id="label3"></span><br />
+        <span wicket:id="label4"></span><br />
+    </wicket:enclosure>
+</div>
+</body>
+</html>

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.java?rev=578574&view=auto
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.java
 (added)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.java
 Sun Sep 23 07:31:15 2007
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.markup.html.internal;
+
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+
+
+/**
+ * Mock page for testing.
+ * 
+ * @author Juergen Donnerstag
+ */
+public class EnclosurePage_2 extends WebPage
+{
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * Construct.
+        */
+       public EnclosurePage_2()
+       {
+               WebMarkupContainer example3 = new 
WebMarkupContainer("example3");
+               example3.add(new Label("label1", "label 1"));
+               example3.add(new Label("label2", "label 2"));
+               example3.add(new Label("label3", "label 3"));
+               example3.add(new Label("label4", "label 4"));
+
+               add(example3);
+
+               example3.get("label3").setVisible(false);
+       }
+}

Propchange: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosurePage_2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java?rev=578574&r1=578573&r2=578574&view=diff
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
 Sun Sep 23 07:31:15 2007
@@ -56,4 +56,12 @@
        {
                executeTest(EnclosurePage_1.class, 
"EnclosurePageExpectedResult_1.html");
        }
+
+       /**
+        * @throws Exception
+        */
+       public void testRenderHomePage2() throws Exception
+       {
+               executeTest(EnclosurePage_2.class, 
"EnclosurePageExpectedResult_2.html");
+       }
 }


Reply via email to