|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 org.apache.wicket.markup.html.form.AbstractSingleSelectChoice
public abstract class AbstractSingleSelectChoice
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 java.lang.String |
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_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
AbstractSingleSelectChoice(java.lang.String id)
|
|
AbstractSingleSelectChoice(java.lang.String id,
IModel choices)
|
|
AbstractSingleSelectChoice(java.lang.String id,
IModel choices,
IChoiceRenderer renderer)
|
|
AbstractSingleSelectChoice(java.lang.String id,
IModel model,
IModel choices)
|
|
AbstractSingleSelectChoice(java.lang.String id,
IModel model,
IModel choices,
IChoiceRenderer renderer)
|
|
AbstractSingleSelectChoice(java.lang.String id,
IModel model,
java.util.List data)
|
|
AbstractSingleSelectChoice(java.lang.String id,
IModel model,
java.util.List data,
IChoiceRenderer renderer)
|
|
AbstractSingleSelectChoice(java.lang.String id,
java.util.List choices)
|
|
AbstractSingleSelectChoice(java.lang.String id,
java.util.List data,
IChoiceRenderer renderer)
|
Method Summary | |
---|---|
protected void |
appendOptionHtml(AppendingStringBuffer buffer,
java.lang.Object choice,
int index,
java.lang.String selected)
Generates and appends html for a single choice into the provided buffer |
protected java.lang.Object |
convertChoiceIdToChoice(java.lang.String id)
Converts submitted choice id string back to choice object. |
protected java.lang.Object |
convertValue(java.lang.String[] value)
Subclasses should overwrite this if the conversion is not done through the type field and the IConverter. |
protected void |
detachModel()
Detaches the model for this component if it is detachable. |
protected java.lang.CharSequence |
escapeOptionHtml(java.lang.String displayValue)
Method to override if you want special escaping of the options html. |
IChoiceRenderer |
getChoiceRenderer()
|
java.util.List |
getChoices()
|
protected java.lang.CharSequence |
getDefaultChoice(java.lang.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. |
java.lang.String |
getModelValue()
|
protected boolean |
isDisabled(java.lang.Object object,
int index,
java.lang.String selected)
Gets whether the given value is disabled. |
boolean |
isNullValid()
Is the null value a valid value? If it is, it means that the null value will
be displayed, typically to the user as 'choose one' or something similar. |
protected boolean |
isSelected(java.lang.Object object,
int index,
java.lang.String selected)
Gets whether the given value represents the current selection. |
protected boolean |
localizeDisplayValues()
Override this method if you want to localize the display values of the generated options. |
protected void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Handle the container's body. |
org.apache.wicket.markup.html.form.AbstractChoice |
setChoiceRenderer(IChoiceRenderer renderer)
Set the choice renderer to be used. |
org.apache.wicket.markup.html.form.AbstractChoice |
setChoices(IModel choices)
Sets the list of choices |
org.apache.wicket.markup.html.form.AbstractChoice |
setChoices(java.util.List choices)
Sets the list of choices. |
AbstractSingleSelectChoice |
setNullValid(boolean nullValid)
Is the null value a valid value? If it is, it means that the null value will
be displayed, typically to the user as 'choose one' or something similar. |
protected boolean |
supportsPersistence()
|
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
---|
add, checkRequired, clearInput, convertInput, error, getBehaviors, getConvertedInput, getForm, getInput, getInputAsArray, getInputName, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isPersistent, isRequired, isValid, onComponentTag, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, setConvertedInput, setLabel, setModelValue, setModelValue, setPersistent, setRequired, setType, shouldTrimInput, trim, updateModel, valid, validate, validateRequired, validateValidators, 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 |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, 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 java.lang.String NO_SELECTION_VALUE
Constructor Detail |
---|
public AbstractSingleSelectChoice(java.lang.String id)
AbstractChoice.AbstractChoice(String)
public AbstractSingleSelectChoice(java.lang.String id, java.util.List choices)
AbstractChoice.AbstractChoice(String, List)
public AbstractSingleSelectChoice(java.lang.String id, java.util.List data, IChoiceRenderer renderer)
id
- data
- renderer
- AbstractChoice.AbstractChoice(String, List ,IChoiceRenderer)
public AbstractSingleSelectChoice(java.lang.String id, IModel model, java.util.List data)
AbstractChoice.AbstractChoice(String, IModel, List)
public AbstractSingleSelectChoice(java.lang.String id, IModel model, java.util.List data, IChoiceRenderer renderer)
id
- model
- data
- renderer
- AbstractChoice.AbstractChoice(String, IModel, List, IChoiceRenderer)
public AbstractSingleSelectChoice(java.lang.String id, IModel choices)
AbstractChoice.AbstractChoice(String, IModel)
public AbstractSingleSelectChoice(java.lang.String id, IModel model, IModel choices)
AbstractChoice.AbstractChoice(String, IModel,IModel)
public AbstractSingleSelectChoice(java.lang.String id, IModel choices, IChoiceRenderer renderer)
AbstractChoice.AbstractChoice(String,
IModel,IChoiceRenderer)
public AbstractSingleSelectChoice(java.lang.String id, IModel model, IModel choices, IChoiceRenderer renderer)
AbstractChoice.AbstractChoice(String, IModel,
IModel,IChoiceRenderer)
Method Detail |
---|
public java.lang.String getModelValue()
getModelValue
in class FormComponent
FormComponent.getModelValue()
public boolean isNullValid()
null
value a valid value? If it is, it means that the null value will
be displayed, typically to the user as 'choose one' or something similar. Note that this
doesn't say anything about whether a null value (not selecting a value) is permitted; use
FormComponent.setRequired(boolean)
for that.
true
when the null
value is allowed.public AbstractSingleSelectChoice setNullValid(boolean nullValid)
null
value a valid value? If it is, it means that the null value will
be displayed, typically to the user as 'choose one' or something similar. Note that this
doesn't say anything about whether a null value (not selecting a value) is permitted; use
FormComponent.setRequired(boolean)
for that.
nullValid
- whether null is a valid value
protected final java.lang.Object convertValue(java.lang.String[] value)
FormComponent
convertValue
in class FormComponent
value
- The value can be the getInput() or through a cookie
FormComponent.convertValue(String[])
protected java.lang.Object convertChoiceIdToChoice(java.lang.String id)
id
- string id of one of the choice objects in the choices list. can be null.
protected java.lang.CharSequence getDefaultChoice(java.lang.Object selected)
selected
- The object that's currently selected
AbstractChoice.getDefaultChoice(Object)
protected boolean isSelected(java.lang.Object object, int index, java.lang.String selected)
index
- The index of the object in the collectionselected
- The current selected id valueobject
- The object to check
public java.util.List getChoices()
public final org.apache.wicket.markup.html.form.AbstractChoice setChoices(IModel choices)
choices
- model representing the list of choices
public final org.apache.wicket.markup.html.form.AbstractChoice setChoices(java.util.List choices)
choices
- the list of choices
public final IChoiceRenderer getChoiceRenderer()
public final org.apache.wicket.markup.html.form.AbstractChoice setChoiceRenderer(IChoiceRenderer renderer)
renderer
-
protected void detachModel()
Component
detachModel
in class Component
Component.detachModel()
protected boolean isDisabled(java.lang.Object object, int index, java.lang.String selected)
object
- The object to checkindex
- The index in the choices collection this object is in.selected
- The currently selected string value
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
onComponentTagBody
in class MarkupContainer
markupStream
- The markup streamopenTag
- The open tag for the bodyComponent.onComponentTagBody(MarkupStream, ComponentTag)
protected void appendOptionHtml(AppendingStringBuffer buffer, java.lang.Object choice, int index, java.lang.String selected)
buffer
- Appending string buffer that will have the generated html appendedchoice
- Choice objectindex
- The index of this optionselected
- The currently selected string valueprotected java.lang.CharSequence escapeOptionHtml(java.lang.String displayValue)
displayValue
-
protected boolean supportsPersistence()
supportsPersistence
in class FormComponent
FormComponent.supportsPersistence()
protected boolean localizeDisplayValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |