编辑
对不起,我第一次没有理解这个问题。
我从未尝试过这个(所以不确定是否可能),但也许您也可以将 ListView 应用于<td>
标签(对于结果),就像在<tr>
标签中完成的一样(对于 PlayerResults)。
爪哇:
List<PlayerResult> players = // ...
ListModel<PlayerResult> playersModel = new ListModel<PlayerResult>(players);
ListView<PlayerResult> list = new ListView<PlayerResult>("list", playersModel) {
@Override
protected void populateItem(ListItem<PlayerResult> item) {
Label name = new Label("name", new PropertyModel<String>(item.getModel(), "player.name"));
Label surname = new Label("surname", new PropertyModel<String>(item.getModel(), "player.surname"));
Label results= new Label("results", item.getModelObject().getResults().size());
ListView<Result> scoreList= new ListView<Result>("scoreList", item.getModelObject().getResults()){
@Override
protected void populateItem(ListItem<Result> resultItem) {
item.add(new Label("score", new PropertyModel<Integer>(resultItem.getModel(), "scoreValue ? ")));
}
}
// ...
item.add(name);
item.add(surname);
item.add(results);
item.add(scoreList);
// ...
}
}
HTML:
<table>
<tr wicket:id="list">
<td><span wicket:id="name">[name label]</span></td>
<td><span wicket:id="surname">[surname label]</span></td>
<td><span wicket:id="results">[results label]</span></td>
<!-- and now variable number of tds -->
<td wicket:id="scoreList">
<span wicket:id="score"></span>
</td>
</tr>
</table>