wicket中有ListView控件,根据情况显示多行
html:
<tr height="72" wicket:id="taskDetail">
<td>升级包 </td>
<font color="red"><td wicket:id="newVersion"></td> </font>
<td>投放版本 </td>
<font color="red"><td wicket:id="oldVersion"></td> </font>
<td>会员类型 </td>
<td wicket:id="useType"><font color="red"> </font></td>
<td><input type="submit" wicket:id="startButton" value="开启"/></td>
<td><input type="submit" wicket:id="stopButton" value="暂停"/></td>
<td><input type="submit" wicket:id="edit" value="修改"/></td>
<tr height="72">
<td>下发</td><td><font color="blue">999999</font></td><td>用户 <br/></td>
<td>下发成功</td><td><font color="blue">999</font></td><td>用户 <br/></td>
</tr>
</tr>
java:
RepeatingView listView = new RepeatingView("taskDetail");
for(Task task:taskList){
final String a = task.getName();
WebMarkupContainer item =new WebMarkupContainer(listView.newChildId());
listView.add(item);
item.add(new Label("newVersion",task.getName()));
item.add(new Label("oldVersion",task.getName()));
item.add(new Label("useType",task.getName()));
item.add(new Button("startButton"){
public void onSubmit(){
System.out.println(a);
info("hello ");
}
});
item.add(new Button("stopButton"){
public void onSubmit(){
info(" world");
}
});
item.add(new Button("edit"){
public void onSubmit(){
setResponsePage(UpdateSet.class);
}
});
}
form.add(listView);