|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
org.apache.wicket.markup.html.form.FormComponent<T>
org.apache.wicket.extensions.markup.html.form.select.Select<T>
T - public class Select<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>
</wicket:container>
</select>
Related Java Code:
Select select = new Select("select", selectionModel);
add(select);
SelectOptions options = new SelectOptions("options", elements, renderer);
select.add(options);
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.
SelectOption,
SelectOptions,
DropDownChoice,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.markup.html.form.FormComponent |
|---|
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, VALUE_SEPARATOR |
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
Select(String id)
Constructor that will create a default model collection |
|
Select(String id,
IModel<T> model)
|
|
| Method Summary | |
|---|---|
protected void |
convertInput()
|
protected String |
getModelValue()
|
protected boolean |
isSelected(IModel<?> model)
Does the given model contain a selected value. |
void |
updateModel()
|
| Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
|---|
add, add, checkRequired, clearInput, convertValue, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getForm, getInput, getInputAsArray, getInputName, getModel, getModelObject, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isRequired, isValid, newValidatable, newValidationError, onComponentTag, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, remove, reportRequiredError, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setRequired, setType, shouldTrimInput, trim, updateCollectionModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder |
| Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer |
|---|
getLabel |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getWebPage, getWebRequest, getWebResponse, getWebSession |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Select(String id)
id - component id
public Select(String id,
IModel<T> model)
id - model - WebMarkupContainer.WebMarkupContainer(String, IModel)| Method Detail |
|---|
protected String getModelValue()
getModelValue in class FormComponent<T>protected void convertInput()
convertInput in class FormComponent<T>public void updateModel()
updateModel in interface IFormModelUpdateListenerupdateModel in class FormComponent<T>FormComponent.updateModel()protected boolean isSelected(IModel<?> model)
model - model to test on selection
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||