In Apache Wicket I would like to create a repeating list of links from code. I am not sure what the template should be to get to an html result that looks like this:
<li><a href="whatevenrlink1">link1</a></li>
<li><a href="whatevenrlink2">link2</a></li>
<li><a href="whatevenrlink3">link3</a></li>
You can use ListView to create a repeating list of links from code. A ListView is a repeater that makes it easy to display/work with Lists. A ListView holds ListItem children. Items can be re-ordered and deleted, either one at a time or many at a time.
Example:
Though this example is about a HTML table, ListView is not at all limited to HTML tables. Any kind of list can be rendered using ListView.
The related Java code:
Where listData contains the id of every link.
There are many choices in how to implement this sort of thing, but they all use some sort of repeater.
See wicket repeater examples for many examples of this.
so after much testing this worked for me. HTML should look like:
and then the repeating view code will be: