Wicket Remove
compref
Source code

wicket.markup.html.form.ListMultipleChoice

[back to the reference]

A ListChoice component lets users select a multiple values from a scrollable list.

Select your favorite sites
Select some of these excellent choices (note that choice 2 is disabled intentionally)


Behind the Scenes

Example HTML

<select wicket:id="sites">
<option>site 1</option>
<option>site 2</option>
</select>
<select wicket:id="choices">
<option>choice 1</option>
<option>choice 2</option>
</select>

Example Code

    // Add a multiple list choice component that uses the model object's 'site'
    // property to designate the current selection, and that uses the SITES
    // list for the available options.
    // Note that our model here holds a Collection, as we need to store
    // multiple values too
    ListMultipleChoice siteChoice = new ListMultipleChoice("sites", SITES);
    form.add(siteChoice);

    ListMultipleChoice manyChoice = new ListMultipleChoice("choices", MANY_CHOICES).setMaxRows(5);
    form.add(manyChoice);

Further examples & and comments/explanations may be available in the source code.