public abstract class JQAccordion
extends org.apache.wicket.markup.html.panel.Panel
This component uses JQuery and the accordion plugin to create client side accordion. Being client side, all content is rendered and sent to the client at first time.
This component is abstract and must be subclassed similarly to
RefreshingView
. Each accordion item to be populated must have two sub
components: a 'title', and a 'content'. You can use Label for these, or for
complex content use a Panel
or a WebMarkupContainer
.
Example:
new JQAccordion("accordion1") { private static final long serialVersionUID = 1L; protected Iterator getItemModels() { return new ArrayIteratorAdapter(new Object[] { "A", "B", "C" }) { protected IModel model(Object obj) { return new Model((Serializable) obj); } }; } protected void populateItem(Item item) { item.add(new Label("title", item.getModel())); item.add(new Label("content", item.getModelObjectAsString() + " content")); } }JQuery: http://jquery.com/
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 |
---|
JQAccordion(String id)
Constructs an accordion component with the given id.
|
JQAccordion(String id,
String options)
Constructs an accordion component with the given id and options.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Iterator<org.apache.wicket.model.IModel<String>> |
getItemModels() |
protected String |
getOptions() |
protected org.apache.wicket.markup.repeater.RefreshingView<String> |
newRepeatingView(String id) |
protected abstract void |
populateItem(org.apache.wicket.markup.repeater.Item<String> item)
Populates one accordion panel item.
|
void |
renderHead(org.apache.wicket.markup.head.IHeaderResponse response) |
getRegionMarkup, newMarkupSourcingStrategy
getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onDetach, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, 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, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, 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, wrap
public JQAccordion(String id)
id
- the id of the component. Must not be null
.public JQAccordion(String id, String options)
See accordion plugin documentation for details about options.
id
- the id of the component. Must not be null
.options
- the options to use for the javascript accordion component.
Must not be null
.public void renderHead(org.apache.wicket.markup.head.IHeaderResponse response)
renderHead
in interface org.apache.wicket.markup.html.IHeaderContributor
renderHead
in class org.apache.wicket.Component
protected String getOptions()
protected org.apache.wicket.markup.repeater.RefreshingView<String> newRepeatingView(String id)
protected abstract void populateItem(org.apache.wicket.markup.repeater.Item<String> item)
Two components must be added to the item:
item
- the item to populateCopyright © 2015. All rights reserved.