为什么 wicket checkGroup 不检查任何东西
Why wicket checkGroup won't check anything
我有两个 List<String>
对象,existingTableList 和 tableList,一个 listview
与 tableList 和 checkgroup
与 existingTableList。
当 existingTableList 和 tableList 具有相同的字符串时,检查组将不会检查它们。我怎样才能使检查组检查两个列表具有的相同字符串。
ListView<String> tableListView = new ListView<String> ("tableListView",tableList) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<String> item) {
String it = item.getModelObject();
item.add(new Label("tableListLabel", it));
item.add(new CheckBox("checkbox", Model.of(Boolean.FALSE)));
}
};
tableListView.setOutputMarkupId(true);
CheckGroup<String> checkGroup= new CheckGroup<String> ("checkGroup", existingTableList);
checkGroup.add(tableListView);
checkGroup.setOutputMarkupId(true);
您必须为 CheckGroup
使用 Check
组件。
CheckBox
组件应该在没有分组的情况下使用
P.S。我知道这真的很混乱。 Check
和 CheckBox
可能应该合并为一个 class 并使其在任何情况下都能正常工作。
我有两个 List<String>
对象,existingTableList 和 tableList,一个 listview
与 tableList 和 checkgroup
与 existingTableList。
当 existingTableList 和 tableList 具有相同的字符串时,检查组将不会检查它们。我怎样才能使检查组检查两个列表具有的相同字符串。
ListView<String> tableListView = new ListView<String> ("tableListView",tableList) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<String> item) {
String it = item.getModelObject();
item.add(new Label("tableListLabel", it));
item.add(new CheckBox("checkbox", Model.of(Boolean.FALSE)));
}
};
tableListView.setOutputMarkupId(true);
CheckGroup<String> checkGroup= new CheckGroup<String> ("checkGroup", existingTableList);
checkGroup.add(tableListView);
checkGroup.setOutputMarkupId(true);
您必须为 CheckGroup
使用 Check
组件。
CheckBox
组件应该在没有分组的情况下使用
P.S。我知道这真的很混乱。 Check
和 CheckBox
可能应该合并为一个 class 并使其在任何情况下都能正常工作。