简体   繁体   English

如何使用Apache Wicket将多个复选框放入表单?

[英]How to put multiple checkboxes into a form with Apache Wicket?

I want to create a webpage that looks like this one: 我想创建一个看起来像这样的网页:

带有多个复选框的表

This is done using a table. 这是使用表格完成的。 Each row describes an object and I want to be able to select multiple of those objects. 每行描述一个对象,我希望能够选择多个这些对象。 When one of the submit-buttons is clicked, I want to get the list of selected objects. 当单击提交按钮之一时,我要获取所选对象的列表。 I know there is the class CheckBoxMultipleChoice , but the generated output is not what I need. 我知道这里有CheckBoxMultipleChoice类,但是生成的输出不是我所需要的。

I think I should use a ListView , but since the number of objects is dynamic, I do not know how to access the states of the checkboxes. 我认为我应该使用ListView ,但是由于对象的数量是动态的,所以我不知道如何访问复选框的状态。 Could you please tell me how I can achieve this layout? 您能告诉我如何实现这种布局吗?

您应该将CheckGroup与每一行中的一个Check组件一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM