Hi there,
When we are using wicket:for into a PropertyListView, the id is not
automatically set on the related input, except if we force it by using
setOutputMarkupId(true).
Outside a propertyListView the id is generated without forcing it.
Please can you tell me if it's normal, if I use it incorrectly or if it is a
bug?
We are using Wicket 8.0.0-M8.
Thanks and regards,
Virginie
HTML:
<tr wicket:id="variations">
<td>
<div class="custom-control custom-checkbox">
<input wicket:id="active" type="checkbox"
class="custom-control-input"/>
<label wicket:for="active"
class="custom-control-label">Active</label>
</div>
</td>
</tr>
Java:
form.add( new PropertyListView<ProductVariation>( "variations" ) {
@Override
protected void populateItem(final ListItem<ProductVariation>
variationItem) {
variationItem.add( new CheckBox( "active" ) );
}
} );
Output HTML: the "for" on the label is there but the "id" on the input is
missing.
<tr>
<td class="align-middle">
<div class="custom-control custom-checkbox">
<input class="custom-control-input beingEdited
pristine" checked="checked" name="variations:0:active" type="checkbox">
<label class="custom-control-label" id="activebb-w-lbl"
for="activebb">Active</label>
</div>
</td>
</tr>