Type Parameters:
T -
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<T,FormComponent<T>>, IMetadataContext<Serializable,Component>, IFormModelUpdateListener, IFormVisitorParticipant, ILabelProvider<String>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Select<T> extends FormComponent<T>
Component that represents a <select> box. Elements are provided by one or more SelectOptions components in the hierarchy below the Select component. Advantages to the standard choice components is that the user has a lot more control over the markup between the <select> tag and its children <option> tags: allowing for such things as <optgroup> tags.

Example HTML:

    <select wicket:id="select" multiple="multiple">
        <wicket:container wicket:id="options">
            <option wicket:id="option">Option Label</option>
Related Java Code:
 Select select = new Select("select", selectionModel);
 SelectOptions options = new SelectOptions("options", elements, renderer);
Note that you don't need to add component(s) for the <option> tag - they are created by SelectOptions

Note: due to the usage of a SelectOption for each <option> the memory footprint of the page will grow with the number of <option>s you need. Consider using DropDownChoice component if it is able to fulfill your requirements.

Igor Vaynberg
See Also: