|
||||||||||
| 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.markup.html.form.AbstractChoice<T,T>
org.apache.wicket.markup.html.form.AbstractSingleSelectChoice<T>
T - The model object typepublic abstract class AbstractSingleSelectChoice<T>
Abstract base class for single-select choices.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.wicket.markup.html.form.FormComponent |
|---|
FormComponent.AbstractVisitor, FormComponent.IVisitor |
| Nested classes/interfaces inherited from class org.apache.wicket.Component |
|---|
Component.ComponentModelChange, Component.EnabledChange, Component.VisibilityChange |
| Field Summary | |
|---|---|
protected static Object |
NO_SELECTION_VALUE
|
| 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_CONFIGURED, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
AbstractSingleSelectChoice(String id)
|
|
AbstractSingleSelectChoice(String id,
IModel<? extends List<? extends T>> choices)
|
|
AbstractSingleSelectChoice(String id,
IModel<? extends List<? extends T>> choices,
IChoiceRenderer<? super T> renderer)
|
|
AbstractSingleSelectChoice(String id,
IModel<T> model,
IModel<? extends List<? extends T>> choices)
|
|
AbstractSingleSelectChoice(String id,
IModel<T> model,
IModel<? extends List<? extends T>> choices,
IChoiceRenderer<? super T> renderer)
|
|
AbstractSingleSelectChoice(String id,
IModel<T> model,
List<? extends T> data)
|
|
AbstractSingleSelectChoice(String id,
IModel<T> model,
List<? extends T> data,
IChoiceRenderer<? super T> renderer)
|
|
AbstractSingleSelectChoice(String id,
List<? extends T> choices)
|
|
AbstractSingleSelectChoice(String id,
List<? extends T> data,
IChoiceRenderer<? super T> renderer)
|
|
| Method Summary | |
|---|---|
protected T |
convertChoiceIdToChoice(String id)
Converts submitted choice id string back to choice object. |
protected T |
convertValue(String[] value)
Subclasses should overwrite this if the conversion is not done through the type field and the IConverter. |
protected CharSequence |
getDefaultChoice(Object selected)
The localizer will be ask for the property to display Depending on if null is allowed or not it will ask for: nullValid: when null is valid and by default it will show an empty string as a choice. null: when null is not a valid choice and it will make a choice with "Choose One" The choice for null is valid will always be returned. |
String |
getModelValue()
|
protected Object |
getNoSelectionValue()
In case "-1" is not a suitable "no selection value", you may provide your own implementation of getNoSelectionValue(). |
protected String |
getNullKey()
Return the localization key for null value |
protected String |
getNullValidKey()
Return the localization key for nullValid value |
boolean |
isNullValid()
Determines whether or not the null value should be included in the list of choices when the field's model value is nonnull, and whether or not the null_valid string property (e.g. |
protected boolean |
isSelected(T object,
int index,
String selected)
Gets whether the given value represents the current selection. |
AbstractSingleSelectChoice<T> |
setNullValid(boolean nullValid)
/** Determines whether or not the null value should be included in the list of choices when the field's model value is nonnull, and whether or not the null_valid string property (e.g. |
| Methods inherited from class org.apache.wicket.markup.html.form.AbstractChoice |
|---|
appendOptionHtml, detachModel, escapeOptionHtml, getChoiceRenderer, getChoices, isDisabled, localizeDisplayValues, onComponentTagBody, setChoiceRenderer, setChoices, setChoices, supportsPersistence |
| Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
|---|
add, add, checkRequired, clearInput, convertInput, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getForm, getInput, getInputAsArray, getInputName, getModel, getModelObject, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isPersistent, isRequired, isValid, newValidatable, onComponentTag, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setModelValue, setPersistent, setRequired, setType, shouldTrimInput, trim, updateModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder |
| Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer |
|---|
getLabel, setLabelInternal |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getMarkupType, getWebPage, getWebRequest |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onAfterRenderChildren, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Object NO_SELECTION_VALUE
| Constructor Detail |
|---|
public AbstractSingleSelectChoice(String id)
AbstractChoice.AbstractChoice(String)
public AbstractSingleSelectChoice(String id,
List<? extends T> choices)
AbstractChoice.AbstractChoice(String, List)
public AbstractSingleSelectChoice(String id,
List<? extends T> data,
IChoiceRenderer<? super T> renderer)
id - data - renderer - AbstractChoice.AbstractChoice(String, List ,IChoiceRenderer)
public AbstractSingleSelectChoice(String id,
IModel<T> model,
List<? extends T> data)
AbstractChoice.AbstractChoice(String, IModel, List)
public AbstractSingleSelectChoice(String id,
IModel<T> model,
List<? extends T> data,
IChoiceRenderer<? super T> renderer)
id - model - data - renderer - AbstractChoice.AbstractChoice(String, IModel, List, IChoiceRenderer)
public AbstractSingleSelectChoice(String id,
IModel<? extends List<? extends T>> choices)
AbstractChoice.AbstractChoice(String, IModel)
public AbstractSingleSelectChoice(String id,
IModel<T> model,
IModel<? extends List<? extends T>> choices)
AbstractChoice.AbstractChoice(String, IModel,IModel)
public AbstractSingleSelectChoice(String id,
IModel<? extends List<? extends T>> choices,
IChoiceRenderer<? super T> renderer)
AbstractChoice.AbstractChoice(String,
IModel,IChoiceRenderer)
public AbstractSingleSelectChoice(String id,
IModel<T> model,
IModel<? extends List<? extends T>> choices,
IChoiceRenderer<? super T> renderer)
AbstractChoice.AbstractChoice(String, IModel,
IModel,IChoiceRenderer)| Method Detail |
|---|
protected Object getNoSelectionValue()
public String getModelValue()
getModelValue in class FormComponent<T>FormComponent.getModelValue()public boolean isNullValid()
FormComponent.setRequired(boolean). This is because even if
setNullValid() is called with false, the user can fail to provide a value simply by never
activating (i.e. clicking on) the component.
true when the null value is allowed.public AbstractSingleSelectChoice<T> setNullValid(boolean nullValid)
FormComponent.setRequired(boolean). This is because even if
setNullValid() is called with false, the user can fail to provide a value simply by never
activating (i.e. clicking on) the component.
nullValid - whether null is a valid value
protected final T convertValue(String[] value)
FormComponentIConverter. WARNING: this method may be removed in future versions.
If conversion fails then a ConversionException should be thrown
convertValue in class FormComponent<T>value - The value can be the getInput() or through a cookie
FormComponent.convertValue(String[])protected T convertChoiceIdToChoice(String id)
id - string id of one of the choice objects in the choices list. can be null.
protected CharSequence getDefaultChoice(Object selected)
getDefaultChoice in class AbstractChoice<T,T>selected - The object that's currently selected
AbstractChoice.getDefaultChoice(Object)protected String getNullValidKey()
protected String getNullKey()
protected boolean isSelected(T object,
int index,
String selected)
isSelected in class AbstractChoice<T,T>index - The index of the object in the collectionselected - The current selected id valueobject - The object to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||