Francis,
Do you use Eclipse for an IDE? I've attached a patch I used for doing
what you want in Unified Diff format. This works on my station from
within the IDE and the wicket-examples project.
Martijn
Index: NestedList.html
===================================================================
RCS file:
/cvsroot/wicket/wicket-examples/src/java/wicket/examples/nested/NestedList.html,v
retrieving revision 1.5
diff -u -r1.5 NestedList.html
--- NestedList.html 17 Mar 2005 22:30:41 -0000 1.5
+++ NestedList.html 28 Jul 2005 10:05:36 -0000
@@ -2,9 +2,7 @@
<wicket:panel>
<ul>
<span wicket:id="rows">
- <li wicket:id="row">
- <span wicket:id="label">the label</span>
- </li>
+ <li wicket:id="row" />
<span wicket:id="nested"/>
</span>
</ul>
Index: NestedList.java
===================================================================
RCS file:
/cvsroot/wicket/wicket-examples/src/java/wicket/examples/nested/NestedList.java,v
retrieving revision 1.6
diff -u -r1.6 NestedList.java
--- NestedList.java 27 May 2005 08:36:44 -0000 1.6
+++ NestedList.java 28 Jul 2005 10:05:36 -0000
@@ -67,6 +67,7 @@
{
Object modelObject = listItem.getModelObject();
+ Panel panel = null;
if(modelObject instanceof List)
{
// create a panel that renders the sub lis
@@ -75,10 +76,11 @@
// if the current element is a list, we create a dummy
row/ label element
// as we have to confirm to our HTML definition, and
set it's visibility
// property to false as we do not want LI tags to be
rendered.
- WebMarkupContainer row = new WebMarkupContainer("row");
- row.setVisible(false);
- row.add(new WebMarkupContainer("label"));
- listItem.add(row);
+ panel = new NestedStaticTextPanel("row", null);
+// WebMarkupContainer row = new WebMarkupContainer("row");
+// row.setVisible(false);
+// row.add(new WebMarkupContainer("label"));
+// listItem.add(row);
}
else
{
@@ -88,12 +90,14 @@
NestedList nested = new NestedList("nested", null);
nested.setVisible(false);
listItem.add(nested);
+ panel = new NestedLinkPanel("row", null);
// add the row (with the LI element attached, and the
label with the
// row's actual value to display
- WebMarkupContainer row = new WebMarkupContainer("row");
- row.add(new Label("label", modelObject.toString()));
- listItem.add(row);
+ //WebMarkupContainer row = new WebMarkupContainer("row");
+ //row.add(new Label("label", modelObject.toString()));
+ //listItem.add(row);
}
+ listItem.add(panel);
}
}
}
Index: NestedLinkPanel.html
===================================================================
RCS file: NestedLinkPanel.html
diff -N NestedLinkPanel.html
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NestedLinkPanel.html 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,8 @@
+<html>
+<body>
+<wicket:panel>
+ <a href="#" wicket:id="myLink"><span wicket:id="label">my
label</span></a>
+ <span wicket:id="foo">Text goes here</span>
+</wicket:panel>
+</body>
+</html>
Index: NestedLinkPanel.java
===================================================================
RCS file: NestedLinkPanel.java
diff -N NestedLinkPanel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NestedLinkPanel.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,17 @@
+package wicket.examples.nested;
+
+import wicket.markup.html.basic.Label;
+import wicket.markup.html.link.ExternalLink;
+import wicket.markup.html.panel.Panel;
+import wicket.model.IModel;
+
+public class NestedLinkPanel extends Panel
+{
+ public NestedLinkPanel(String id, IModel model)
+ {
+ super(id, model);
+ add(new ExternalLink("myLink", "http://www.google.com").add(new
Label("label", "Go to google")));
+ add(new Label("foo", "Hello, World!"));
+ }
+
+}
Index: NestedStaticTextPanel.html
===================================================================
RCS file: NestedStaticTextPanel.html
diff -N NestedStaticTextPanel.html
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NestedStaticTextPanel.html 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,8 @@
+<html>
+<body>
+<wicket:panel>
+ <span wicket:id="label">my label</span>
+ <span wicket:id="foo">Text goes here</span>
+</wicket:panel>
+</body>
+</html>
Index: NestedStaticTextPanel.java
===================================================================
RCS file: NestedStaticTextPanel.java
diff -N NestedStaticTextPanel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ NestedStaticTextPanel.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,18 @@
+package wicket.examples.nested;
+
+import wicket.markup.html.basic.Label;
+import wicket.markup.html.panel.Panel;
+import wicket.model.IModel;
+
+public class NestedStaticTextPanel extends Panel
+{
+
+ public NestedStaticTextPanel(String id, IModel model)
+ {
+ super(id, model);
+ add(new Label("label", "My hidden label"));
+ add(new Label("foo", "Hello, again"));
+ setVisible(false);
+ }
+
+}
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September
19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user