|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.Component
wicket.MarkupContainer
wicket.markup.html.WebMarkupContainer
wicket.markup.html.form.FormComponent
wicket.markup.html.form.AbstractChoice
wicket.markup.html.form.AbstractSingleSelectChoice
wicket.markup.html.form.DropDownChoice
A choice implemented as a dropdown menu/list. TODO elaborate with an example
You can can extend this class and override method wantOnSelectionChangedNotifications() to force server roundtrips on each selection change.
| Nested Class Summary |
| Nested classes inherited from class wicket.markup.html.form.FormComponent |
FormComponent.IVisitor |
| Nested classes inherited from class wicket.Component |
Component.ComponentModelChange, Component.VisibilityChange |
| Field Summary |
| Fields inherited from class wicket.markup.html.form.FormComponent |
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, NO_INVALID_INPUT |
| Fields inherited from class wicket.Component |
FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4 |
| Constructor Summary | |
DropDownChoice(java.lang.String id)
|
|
DropDownChoice(java.lang.String id,
java.util.Collection choices)
|
|
DropDownChoice(java.lang.String id,
IChoiceList choices)
|
|
DropDownChoice(java.lang.String id,
IModel model,
java.util.Collection choices)
|
|
DropDownChoice(java.lang.String id,
IModel model,
IChoiceList choices)
|
|
| Method Summary | |
protected void |
detachModel()
Detaches the model for this component if it is detachable. |
IChoiceList |
getChoices()
Gets the list of choices. |
protected java.lang.String |
getDefaultChoice(java.lang.Object selected)
|
java.lang.String |
getModelValue()
|
boolean |
isNullValid()
Is the null value a valid value? |
protected boolean |
isSelected(IChoice choice)
Gets whether the given value represents the current selection. |
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag. |
protected void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Handle the container's body. |
void |
onSelectionChanged()
Called when a selection changes. |
protected void |
onSelectionChanged(java.lang.Object newSelection)
Template method that can be overriden by clients that implement IOnChangeListener to be notified by onChange events of a select element. |
void |
setChoices(IChoiceList choices)
Sets the list of choices. |
void |
setModelValue(java.lang.String value)
Sets the value for a form component. |
void |
setNullValid(boolean nullValid)
Is the null value a valid value? |
protected boolean |
supportsPersistence()
|
protected void |
updateModel()
Updates this components' model from the request. |
protected boolean |
wantOnSelectionChangedNotifications()
Whether this component's onSelectionChanged event handler should called using javascript if the selection changes. |
| Methods inherited from class wicket.markup.html.form.FormComponent |
add, getForm, getInput, getValidationType, getValidators, getValue, inputAsInt, inputAsInt, inputAsIntArray, inputAsStringArray, invalid, isPersistent, isValid, isValidated, onInvalid, onModelChanged, onValid, setPersistent, valid, validate |
| Methods inherited from class wicket.markup.html.WebMarkupContainer |
getMarkupType, onRender |
| Methods inherited from class wicket.MarkupContainer |
add, autoAdd, contains, findMarkupStream, get, getMarkupStream, internalAdd, internalBeginRequest, internalEndRequest, iterator, remove, removeAll, 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 |
| Constructor Detail |
public DropDownChoice(java.lang.String id)
AbstractChoice.AbstractChoice(String)
public DropDownChoice(java.lang.String id,
java.util.Collection choices)
AbstractChoice.AbstractChoice(String, Collection)
public DropDownChoice(java.lang.String id,
IChoiceList choices)
AbstractChoice.AbstractChoice(String, IChoiceList)
public DropDownChoice(java.lang.String id,
IModel model,
java.util.Collection choices)
AbstractChoice.AbstractChoice(String, IModel, Collection)
public DropDownChoice(java.lang.String id,
IModel model,
IChoiceList choices)
AbstractChoice.AbstractChoice(String, IModel, IChoiceList)| Method Detail |
public final void onSelectionChanged()
onSelectionChanged in interface IOnChangeListenerprotected void onComponentTag(ComponentTag tag)
onComponentTag in class FormComponenttag - Tag to modifyComponent.onComponentTag(wicket.markup.ComponentTag)protected void onSelectionChanged(java.lang.Object newSelection)
Called when a option is selected of a dropdown list that wants to be notified of this event. This method is to be implemented by clients that want to be notified of selection events.
newSelection - The newly selected object of the backing model NOTE this is
the same as you would get by calling getModelObject() if the
new selection were currentprotected boolean wantOnSelectionChangedNotifications()
public final java.lang.String getModelValue()
getModelValue in class FormComponentFormComponent.getModelValue()public boolean isNullValid()
null value a valid value?
true when the null value is
allowed.public void setNullValid(boolean nullValid)
null value a valid value?
nullValid - whether null is a valid valuepublic final void setModelValue(java.lang.String value)
FormComponent
setModelValue in class FormComponentvalue - The valueFormComponent.setModelValue(java.lang.String)protected java.lang.String getDefaultChoice(java.lang.Object selected)
selected - The object that's currently selected
AbstractChoice.getDefaultChoice(Object)protected boolean isSelected(IChoice choice)
choice - The choice to check
protected final void updateModel()
AbstractChoice.updateModel()public IChoiceList getChoices()
public final void setChoices(IChoiceList choices)
choices - the list of choicesprotected void detachModel()
Component
detachModel in class ComponentComponent.detachModel()
protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
onComponentTagBody in class MarkupContainermarkupStream - The markup streamopenTag - The open tag for the bodyComponent.onComponentTagBody(MarkupStream, ComponentTag)protected boolean supportsPersistence()
supportsPersistence in class FormComponentFormComponent.supportsPersistence()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||