Hi,
basically the reason is WICKET-6088. Before this issue many bugs related
to component queueing happened because a component was inside an
autocomponent, hence i couldn't be dequeued before rendering phase was
started. The common solution to solve this kind of problems was to make
a specific component (an Eclosure, a ListItem, etc...) a IQueueRegion.
But since WICKET-6088 autocomponents are resolved earlier and now (as
good side effect) components can be dequeued even if their markup is
inside an autocomponent. In short WICKET-6088 made obsolete any previous
solution based on making components IQueueRegion.
The test was added just for sanity-check. Maybe I should rename test
method to something more meaningful?
On 01/04/2016 16:59, Martin Grigorov wrote:
Hi Andrea,
I didn't understand how the use case from WICKET-6043 works now.
So, you reverted the commit that was a fix for 6043 and added a test case
that verifies that the problem is fixed. But how is it fixed ?
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov
On Fri, Apr 1, 2016 at 4:17 PM, <adelb...@apache.org> wrote:
Repository: wicket
Updated Branches:
refs/heads/wicket-7.x 7443da58c -> b465aedfb
WICKET-6134 Added regression test for WICKET-6043
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b465aedf
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b465aedf
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b465aedf
Branch: refs/heads/wicket-7.x
Commit: b465aedfb86e9dd72fcf5439da1ab4c26a2191a7
Parents: 7443da5
Author: Andrea Del Bene <adelb...@apache.org>
Authored: Fri Apr 1 16:15:47 2016 +0200
Committer: Andrea Del Bene <adelb...@apache.org>
Committed: Fri Apr 1 16:15:47 2016 +0200
----------------------------------------------------------------------
.../wicket/markup/html/internal/BasePage.html | 14 +++++
.../wicket/markup/html/internal/BasePage.java | 29 ++++++++++
.../markup/html/internal/EnclosureTest.java | 10 ++++
.../html/internal/ListViewInContainerPage.html | 23 ++++++++
.../html/internal/ListViewInContainerPage.java | 60 ++++++++++++++++++++
5 files changed, 136 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/b465aedf/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.html
----------------------------------------------------------------------
diff --git
a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.html
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.html
new file mode 100644
index 0000000..495ac59
--- /dev/null
+++
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html xmlns:wicket="http://wicket.apache.org">
+ <head>
+ <meta charset="utf-8" />
+
+ <title>Apache Wicket Quickstart</title>
+
+ <link href='
http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold'
rel='stylesheet' type='text/css' />
+ <link rel="stylesheet" href="style.css" type="text/css"
media="screen" title="Stylesheet" />
+ </head>
+ <body>
+ <wicket:child />
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/wicket/blob/b465aedf/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.java
----------------------------------------------------------------------
diff --git
a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.java
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.java
new file mode 100644
index 0000000..643c098
--- /dev/null
+++
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/BasePage.java
@@ -0,0 +1,29 @@
+/*
+ * 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.WebPage;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class BasePage extends WebPage {
+
+ public BasePage(PageParameters parameters)
+ {
+ super(parameters);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/wicket/blob/b465aedf/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
----------------------------------------------------------------------
diff --git
a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
index 8ddc60a..b661ef9 100644
---
a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
+++
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/EnclosureTest.java
@@ -445,6 +445,16 @@ public class EnclosureTest extends WicketTestCase
tester.startPage(p);
}
+ /**
+ * Test case for https://issues.apache.org/jira/browse/WICKET-6043
+ */
+ @Test
+ public void enclosureInsideContainererAndInheritance() throws
Exception
+ {
+ tester.startPage(ListViewInContainerPage.class);
+ tester.assertRenderedPage(ListViewInContainerPage.class);
+ }
+
private static class TestPageMarkup extends WebPage implements
IMarkupResourceStreamProvider
{
private String markup;
http://git-wip-us.apache.org/repos/asf/wicket/blob/b465aedf/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.html
----------------------------------------------------------------------
diff --git
a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.html
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.html
new file mode 100644
index 0000000..59510b4
--- /dev/null
+++
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<wicket:extend xmlns:wicket="http://wicket.apache.org">
+ <div id="hd">
+ <div id="logo">
+ <img src="logo.png" width="50px" height="50px"
alt="Wicket Logo" />
+ <h1>Apache Wicket</h1>
+ </div>
+ </div>
+ <div id="bd">
+
+ <div wicket:id="liste">
+ <wicket:enclosure child="testenc">
+ <span wicket:id="testenc"></span>
+ </wicket:enclosure>
+ <span wicket:id="testlib"></span>
+ </div>
+ <p>
+ Please mention the correct Wicket version:
<wicket:container wicket:id="version">1.5-SNAPSHOT</wicket:container>.
+ </p>
+ </div>
+ <div id="ft">
+ </div>
+</wicket:extend>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/wicket/blob/b465aedf/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.java
----------------------------------------------------------------------
diff --git
a/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.java
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.java
new file mode 100644
index 0000000..58f9e3f
--- /dev/null
+++
b/wicket-core/src/test/java/org/apache/wicket/markup/html/internal/ListViewInContainerPage.java
@@ -0,0 +1,60 @@
+/*
+ * 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 java.util.ArrayList;
+
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class ListViewInContainerPage extends BasePage
+{
+ private static final long serialVersionUID = 1L;
+
+ public ListViewInContainerPage(final PageParameters parameters)
+ {
+ super(parameters);
+
+ add(new Label("version",
getApplication().getFrameworkSettings().getVersion()));
+
+ ArrayList<Integer> values = new ArrayList<>();
+ values.add(1);
+ values.add(2);
+ values.add(3);
+
+ add(new ListView<Integer>("liste", values)
+ {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void populateItem(final
ListItem<Integer> item)
+ {
+ final Label testenc = new Label("testenc",
Model.of("enclosure " + item.getModelObject()));
+ item.queue(testenc);
+
+ final Label testlib = new Label("testlib",
Model.of("no enclosure " + item.getModelObject()));
+ item.queue(testlib);
+ }
+ });
+ }
+}