wicket.markup.html.form
Class CheckBox
java.lang.Object
wicket.Component
wicket.MarkupContainer
wicket.markup.html.WebMarkupContainer
wicket.markup.html.form.FormComponent
wicket.markup.html.form.CheckBox
- All Implemented Interfaces:
- IOnChangeListener, IRequestListener, java.io.Serializable
- public class CheckBox
- extends FormComponent
- implements IOnChangeListener
HTML checkbox input component.
TODO elaborate with an example
You can can extend this class and override method wantOnSelectionChangedNotifications()
to force server roundtrips on each selection change.
- Author:
- Jonathan Locke
- See Also:
- Serialized Form
|
Method Summary |
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag. |
void |
onSelectionChanged()
Called when a new option is selected. |
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 |
setModelValue(java.lang.String value)
Sets the value for a form component. |
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, getModelValue, getValidationType, getValidators, getValue, inputAsInt, inputAsInt, inputAsIntArray, inputAsStringArray, invalid, isPersistent, isValid, isValidated, onInvalid, onModelChanged, onValid, setPersistent, valid, validate |
| Methods inherited from class wicket.MarkupContainer |
add, autoAdd, contains, findMarkupStream, get, getMarkupStream, internalAdd, internalBeginRequest, internalEndRequest, iterator, onComponentTagBody, remove, removeAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren |
| Methods inherited from class wicket.Component |
add, addStateChange, checkComponentTag, checkComponentTagAttribute, debug, detachModel, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getId, getLocale, getLocalizer, getModel, getModelObject, getModelObjectAsString, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResource, getResponse, getSession, getString, getString, getString, getStyle, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnBeginRequest, internalOnEndRequest, internalOnModelChanged, internalOnModelChanging, isAncestorOf, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onBeginRequest, onEndRequest, onModelChanging, onSessionAttach, redirectTo, remove, render, renderComponent, renderComponentTag, rendered, replaceComponentTagBody, sameRootModel, sameRootModel, setFlag, setModelObject, setRedirect, setRenderBodyOnly, setResponsePage, setShouldEscapeModelStrings, setVersioned, setVisible, urlFor, visitParents, warn |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CheckBox
public CheckBox(java.lang.String id)
- See Also:
Component.Component(String)
CheckBox
public CheckBox(java.lang.String id,
IModel model)
- See Also:
Component.Component(String, IModel)
setModelValue
public final void setModelValue(java.lang.String value)
- Description copied from class:
FormComponent
- Sets the value for a form component.
- Overrides:
setModelValue in class FormComponent
- Parameters:
value - The value- See Also:
FormComponent.setModelValue(java.lang.String)
onSelectionChanged
public void onSelectionChanged()
- Description copied from interface:
IOnChangeListener
- Called when a new option is selected.
- Specified by:
onSelectionChanged in interface IOnChangeListener
- See Also:
IOnChangeListener.onSelectionChanged()
onSelectionChanged
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.
This method does nothing by default.
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.
- Parameters:
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 current
wantOnSelectionChangedNotifications
protected boolean wantOnSelectionChangedNotifications()
- Whether this component's onSelectionChanged event handler should called using
javascript if the selection changes. If true, a roundtrip will be generated with
each selection change, resulting in the model being updated (of just this component)
and onSelectionChanged being called. This method returns false by default.
- Returns:
- True if this component's onSelectionChanged event handler should
called using javascript if the selection changes
onComponentTag
protected final void onComponentTag(ComponentTag tag)
- Processes the component tag.
- Overrides:
onComponentTag in class FormComponent
- Parameters:
tag - Tag to modify- See Also:
Component.onComponentTag(ComponentTag)
supportsPersistence
protected final boolean supportsPersistence()
- Overrides:
supportsPersistence in class FormComponent
- Returns:
- True if this type of FormComponent can be persisted.
- See Also:
FormComponent.supportsPersistence()
updateModel
protected void updateModel()
- Updates this components' model from the request.
- Specified by:
updateModel in class FormComponent
- See Also:
FormComponent.updateModel()
Copyright © 2004-2005 Wicket developers. All Rights Reserved.