T - the generic typepublic class CheckChoicesListView<T> extends ChoicesListView<T>
IChoiceRenderer. When used in combination with a
CheckGroup, this a good alternative to Wicket's
built-in CheckBoxMultipleChoice, because it gives you
full control over the markup and is extensible.
Your markup have to contain the following:
<input type="checkbox" wicket:id="check" /> where you want the checkbox to appear.
wicket:id="label" where you want the display value to appear.For example:
<wicket:container wicket:id="group">
<label wicket:id="choices">
<input type="checkbox" wicket:id="check" />
<wicket:container wicket:id="label">Label</wicket:container>
</label>
</wicket:container>
add(new CheckGroup("group", selectedItemsModel)
.add(new CheckChoicesListView("choices", choicesModel, renderer)));
You can also override populateItem() if you want to display
additional data per checkbox choice, like a description paragraph.
This class is inspired from fiftyfive.wicket.core project. Some changes with the generic types
was done.
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING| Constructor and Description |
|---|
CheckChoicesListView(String id,
org.apache.wicket.model.IModel<List<T>> choices,
org.apache.wicket.markup.html.form.IChoiceRenderer<T> renderer)
Construct a list view for
Check objects that will expose the specified
IChoiceRenderer for rendering its list items. |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.wicket.markup.html.form.Check<T> |
newCheck(String id,
org.apache.wicket.model.IModel<T> model,
int index)
Factory method for create a new
Check. |
protected org.apache.wicket.markup.html.basic.Label |
newLabel(String id,
String label)
Factory method for creating the new
Label. |
protected void |
populateItem(org.apache.wicket.markup.html.list.ListItem<T> item) |
getChoiceLabel, getChoiceRenderer, getChoiceValuegetList, getListItemModel, getModel, getModelObject, getReuseItems, getStartIndex, getViewSize, moveDownLink, moveUpLink, newItem, onBeginPopulateItem, onPopulate, removeLink, renderChild, renderItem, renderIterator, setList, setModel, setModelObject, setReuseItems, setStartIndex, setViewSizedequeue, getMarkup, onBeforeRender, onRendergetWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionadd, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeuePreamble, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onDetach, onInitialize, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic CheckChoicesListView(String id, org.apache.wicket.model.IModel<List<T>> choices, org.apache.wicket.markup.html.form.IChoiceRenderer<T> renderer)
Check objects that will expose the specified
IChoiceRenderer for rendering its list items.id - the idchoices - the list of choicesrenderer - the choice rendererprotected org.apache.wicket.markup.html.form.Check<T> newCheck(String id, org.apache.wicket.model.IModel<T> model, int index)
Check. This method is invoked in the constructor from
the derived classes and can be overridden so users can provide their own version of a new
Check.id - the idmodel - the modelindex - the indexCheck.protected org.apache.wicket.markup.html.basic.Label newLabel(String id, String label)
Label. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
new Label.id - the idlabel - the string for the labelLabelCopyright © 2010–2016 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.