|
||||||||||
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<T> org.apache.wicket.markup.html.form.AbstractChoice<Collection<T>,T> org.apache.wicket.markup.html.form.ListMultipleChoice<T> org.apache.wicket.markup.html.form.CheckBoxMultipleChoice<T>
T
- The model object typepublic class CheckBoxMultipleChoice<T>
A choice subclass that shows choices via checkboxes.
Java:
List SITES = Arrays.asList(new String[] { "The Server Side", "Java Lobby", "Java.Net" }); // Add a set of checkboxes uses Input's 'site' property to designate the // current selections, and that uses the SITES list for the available options. form.add(new CheckBoxMultipleChoice("site", SITES));HTML:
<span valign="top" wicket:id="site"> <input type="checkbox">site 1</input> <input type="checkbox">site 2</input> </span>
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, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
CheckBoxMultipleChoice(String id)
Constructor |
|
CheckBoxMultipleChoice(String id,
IModel<? extends Collection<T>> model,
IModel<? extends List<? extends T>> choices)
Constructor |
|
CheckBoxMultipleChoice(String id,
IModel<? extends Collection<T>> model,
IModel<? extends List<? extends T>> choices,
IChoiceRenderer<? super T> renderer)
Constructor |
|
CheckBoxMultipleChoice(String id,
IModel<? extends Collection<T>> model,
List<? extends T> choices)
Constructor |
|
CheckBoxMultipleChoice(String id,
IModel<? extends Collection<T>> model,
List<? extends T> choices,
IChoiceRenderer<? super T> renderer)
Constructor |
|
CheckBoxMultipleChoice(String id,
IModel<? extends List<? extends T>> choices)
Constructor |
|
CheckBoxMultipleChoice(String id,
IModel<? extends List<? extends T>> choices,
IChoiceRenderer<? super T> renderer)
Constructor |
|
CheckBoxMultipleChoice(String id,
List<? extends T> choices)
Constructor |
|
CheckBoxMultipleChoice(String id,
List<? extends T> choices,
IChoiceRenderer<? super T> renderer)
Constructor |
Method Summary | |
---|---|
protected void |
appendOptionHtml(AppendingStringBuffer buffer,
T choice,
int index,
String selected)
Generates and appends html for a single choice into the provided buffer |
protected String |
getCheckBoxMarkupId(String id)
Creates markup id for the input tag used to generate the checkbox for the element with the specified id . |
String |
getPrefix()
|
String |
getSuffix()
|
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag. |
void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Handle the container's body. |
CheckBoxMultipleChoice<T> |
setPrefix(String prefix)
|
CheckBoxMultipleChoice<T> |
setSuffix(String suffix)
|
Methods inherited from class org.apache.wicket.markup.html.form.ListMultipleChoice |
---|
convertChoiceIdsToChoices, convertValue, getDefaultMaxRows, getModelValue, isRetainDisabledSelected, isSelected, setDefaultMaxRows, setMaxRows, setRetainDisabledSelected, updateModel |
Methods inherited from class org.apache.wicket.markup.html.form.AbstractChoice |
---|
detachModel, escapeOptionHtml, getChoiceRenderer, getChoices, getDefaultChoice, isDisabled, localizeDisplayValues, setChoiceRenderer, setChoices, setChoices |
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
---|
add, add, checkRequired, clearInput, convertInput, error, getConvertedInput, getForm, getInput, getInputAsArray, getInputName, getModel, getModelObject, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isMultiPart, isRequired, isValid, newValidatable, onDetach, onDisabled, onInvalid, onValid, processChildren, processInput, remove, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setRequired, setType, shouldTrimInput, trim, 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 |
---|
getWebPage, getWebRequest |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, hasAssociatedMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onMarkupAttached, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CheckBoxMultipleChoice(String id)
id
- See ComponentComponent.Component(String)
,
AbstractChoice.AbstractChoice(String)
public CheckBoxMultipleChoice(String id, List<? extends T> choices)
id
- See Componentchoices
- The collection of choices in the radio choiceComponent.Component(String)
,
AbstractChoice.AbstractChoice(String, java.util.List)
public CheckBoxMultipleChoice(String id, List<? extends T> choices, IChoiceRenderer<? super T> renderer)
id
- See Componentrenderer
- The rendering enginechoices
- The collection of choices in the radio choiceComponent.Component(String)
,
AbstractChoice.AbstractChoice(String,
java.util.List,org.apache.wicket.markup.html.form.IChoiceRenderer)
public CheckBoxMultipleChoice(String id, IModel<? extends Collection<T>> model, List<? extends T> choices)
id
- See Componentmodel
- See Componentchoices
- The collection of choices in the radio choiceComponent.Component(String, org.apache.wicket.model.IModel)
,
AbstractChoice.AbstractChoice(String, org.apache.wicket.model.IModel, java.util.List)
public CheckBoxMultipleChoice(String id, IModel<? extends Collection<T>> model, List<? extends T> choices, IChoiceRenderer<? super T> renderer)
id
- See Componentmodel
- See Componentchoices
- The collection of choices in the radio choicerenderer
- The rendering engineComponent.Component(String, org.apache.wicket.model.IModel)
,
AbstractChoice.AbstractChoice(String, org.apache.wicket.model.IModel,
java.util.List,org.apache.wicket.markup.html.form.IChoiceRenderer)
public CheckBoxMultipleChoice(String id, IModel<? extends List<? extends T>> choices)
id
- See Componentchoices
- The collection of choices in the radio choiceComponent.Component(String)
,
AbstractChoice.AbstractChoice(String, org.apache.wicket.model.IModel)
public CheckBoxMultipleChoice(String id, IModel<? extends Collection<T>> model, IModel<? extends List<? extends T>> choices)
id
- See Componentmodel
- The model that is updated with changes in this component. See Componentchoices
- The collection of choices in the radio choiceAbstractChoice.AbstractChoice(String,
org.apache.wicket.model.IModel,org.apache.wicket.model.IModel)
,
Component.Component(String, org.apache.wicket.model.IModel)
public CheckBoxMultipleChoice(String id, IModel<? extends List<? extends T>> choices, IChoiceRenderer<? super T> renderer)
id
- See Componentchoices
- The collection of choices in the radio choicerenderer
- The rendering engineAbstractChoice.AbstractChoice(String,
org.apache.wicket.model.IModel,org.apache.wicket.markup.html.form.IChoiceRenderer)
,
Component.Component(String)
public CheckBoxMultipleChoice(String id, IModel<? extends Collection<T>> model, IModel<? extends List<? extends T>> choices, IChoiceRenderer<? super T> renderer)
id
- See Componentmodel
- The model that is updated with changes in this component. See Componentchoices
- The collection of choices in the radio choicerenderer
- The rendering engineComponent.Component(String, org.apache.wicket.model.IModel)
,
AbstractChoice.AbstractChoice(String, org.apache.wicket.model.IModel,
org.apache.wicket.model.IModel,org.apache.wicket.markup.html.form.IChoiceRenderer)
Method Detail |
---|
public String getPrefix()
public final CheckBoxMultipleChoice<T> setPrefix(String prefix)
prefix
- Prefix to use before choice
public String getSuffix()
public final CheckBoxMultipleChoice<T> setSuffix(String suffix)
suffix
- Separator to use between radio options
protected void onComponentTag(ComponentTag tag)
FormComponent
onComponentTag
in class ListMultipleChoice<T>
tag
- Tag to modifyListMultipleChoice.onComponentTag(org.apache.wicket.markup.ComponentTag)
public final void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
AbstractChoice
onComponentTagBody
in class AbstractChoice<Collection<T>,T>
markupStream
- The markup streamopenTag
- The open tag for the bodyComponent.onComponentTagBody(org.apache.wicket.markup.MarkupStream,
org.apache.wicket.markup.ComponentTag)
protected void appendOptionHtml(AppendingStringBuffer buffer, T choice, int index, String selected)
appendOptionHtml
in class AbstractChoice<Collection<T>,T>
buffer
- Appending string buffer that will have the generated html appendedchoice
- Choice objectindex
- The index of this optionselected
- The currently selected string valueprotected String getCheckBoxMarkupId(String id)
id
.
NOTE It is useful to override this method if the contract for the genreated ids should be fixed, for example in cases when the id generation pattern in this method is used to predict ids by some external javascript. If the contract is fixed in the user's code then upgrading wicket versions will guarantee not to break it should the default contract be changed at a later time.
id
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |