org.wicketstuff.jquery.accordion
Class JQAccordion
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
org.wicketstuff.jquery.accordion.JQAccordion
- All Implemented Interfaces:
- Serializable, Iterable<Component>, IEventSink, IEventSource, IClusterable, IConverterLocator, IHeaderContributor, IRequestableComponent, IHierarchical<Component>
public abstract class JQAccordion
- extends Panel
JQuery based implementation of client side accordion.
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/
Accordion: http://bassistance.de/jquery-plugins/jquery-plugin-accordion/
- Author:
- Xavier Hanin
- See Also:
- Serialized Form
| Fields inherited from class org.apache.wicket.markup.html.panel.Panel |
PANEL |
| 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, PARENT_PATH, PATH_SEPARATOR, RENDER |
| Methods inherited from class org.apache.wicket.MarkupContainer |
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, hasAssociatedMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onMarkupAttached, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren |
| Methods inherited from class org.apache.wicket.Component |
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, 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, getFeedbackMessage, 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, locateMarkupStream, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, 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, urlFor, urlFor, visitParents, warn, wrap |
JQAccordion
public JQAccordion(String id)
- Constructs an accordion component with the given id.
- Parameters:
id - the id of the component. Must not be null.
JQAccordion
public JQAccordion(String id,
String options)
- Constructs an accordion component with the given id and options.
See accordion plugin
documentation for details about options.
- Parameters:
id - the id of the component. Must not be null.options - the options to use for the javascript accordion component. Must not be
null.
renderHead
public void renderHead(IHeaderResponse response)
- Specified by:
renderHead in interface IHeaderContributor- Overrides:
renderHead in class Component
getOptions
protected String getOptions()
newRepeatingView
protected RefreshingView<String> newRepeatingView(String id)
populateItem
protected abstract void populateItem(Item<String> item)
- Populates one accordion panel item.
Two components must be added to the item:
- "title"
the title of the panel
- "content"
the content of the panel
- Parameters:
item - the item to populate
getItemModels
protected abstract Iterator<IModel<String>> getItemModels()
Copyright © 2013. All Rights Reserved.