Reputation: 33
I implemented CheckBoxMultipleChoice with items at run time, now I need to complete with an option to mark all. I have used the CheckGroup but apparently it is not working, any advice is welcome.
Here is my html code:
<span wicket:id="group">
<input type="checkbox" wicket:id="groupselector"> check/uncheck all </input>
<div class="modal-body">
<div class="row-fluid">
<div class="clearfix">
<div wicket:id="contratos"></div>
</div>
</div>
</div>
</span>
And java Code:
Form<ContratoList> formData;
add(formData = new Form<>("formulario", new CompoundPropertyModel<>(contratoListIModel)));
CheckGroup group = new CheckGroup("group");
group.add(new CheckGroupSelector("groupselector"));
group.add(new CheckBoxMultipleChoice<>("contratos",
TipoServicio.getTodos(), TipoServicio.getCR()).
setOutputMarkupId(true)); /* Here get items, works fine*/
formData.add(group);
Upvotes: 1
Views: 196
Reputation: 5681
For CheckBoxMultipleChoice
you should use a CheckboxMultipleChoiceSelector
.
Just remove the CheckGroup
, it is an alternative to CheckBoxMultipleChoice, not something to be used together.
Upvotes: 1