T - the generic typepublic class RadioChoicesListView<T> extends ChoicesListView<T>
IChoiceRenderer. When used in combination with a
RadioGroup, this a good alternative to Wicket's
built-in RadioChoice, because it gives you full
control over the markup and is extensible.
Your markup must contain the following:
<input type="radio" wicket:id="radio" /> where you want the radio button 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="radio" wicket:id="radio" />
<wicket:container wicket:id="label">Label</wicket:container>
</label>
</wicket:container>
add(new RadioGroup("group", selectedItemModel)
.add(new RadioChoicesListView("choices", choicesModel, renderer)));
You can also override populateItem() if you want to display
additional data per radio choice, like a description paragraph.
This class is inspired from fiftyfive.wicket.core project. Some changes with the generic types
was done. For more information read this blog: http://blog.55minutes.com/2011/10/how-to-implement-radio-buttons-in-wicket/
| Constructor and Description |
|---|
RadioChoicesListView(String id,
org.apache.wicket.model.IModel<List<T>> choices,
org.apache.wicket.markup.html.form.IChoiceRenderer<T> renderer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
populateItem(org.apache.wicket.markup.html.list.ListItem<T> it) |
getChoiceLabel, getChoiceRenderer, getChoiceValuegetList, getListItemModel, getModel, getModelObject, getReuseItems, getStartIndex, getViewSize, moveDownLink, moveUpLink, newItem, onBeginPopulateItem, onPopulate, removeLink, renderChild, renderItem, renderIterator, setList, setModel, setModelObject, setReuseItems, setStartIndex, setViewSizegetMarkup, onBeforeRender, onRendergetWebPage, getWebRequest, getWebResponse, getWebSessionadd, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, 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, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, 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, spliteratorCopyright © 2010–2015. All rights reserved.