我想通过wicket生成这个表头
<tr>
<th>Actions</th>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Home Phone</th>
<th>Cell Phone</th>
</tr>
header 名称保存在arrayList
我尝试这样的事情。它生成我想要的内容,但在 html 代码中它显示警告
- Invalid location of tag (div).
好的一点是 div 标签不会显示在生成的 html 代码中。
当我只想要 th
而没有 span
标签
<tr>
<div wicket:id="seasonNames"><th wicket:id="season">[season]</th></div>
</tr>
最佳答案
一种方法是使用 DataTable 组件。在这种情况下,您必须传递 IColumn
实例列表并使用 HeaderToolbar。请参阅此方法的 Wicket 示例。
另一种方法是使用简单的转发器,例如 RepeatingView 或 ListView。在这种情况下, 关于java - 如何使用 wicket 生成表头,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/34673457/
wicket:id="seasonNames"
应该是