Class AccordionPanel

  • All Implemented Interfaces:
    com.googlecode.wicket.jquery.core.IJQueryWidget, IAccordionListener, Serializable, Iterable<org.apache.wicket.Component>, org.apache.wicket.event.IEventSink, org.apache.wicket.event.IEventSource, org.apache.wicket.feedback.IFeedbackContributor, org.apache.wicket.IConverterLocator, org.apache.wicket.IGenericComponent<List<org.apache.wicket.extensions.markup.html.tabs.ITab>,​com.googlecode.wicket.jquery.core.JQueryGenericPanel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>>>, org.apache.wicket.IMetadataContext<Serializable,​org.apache.wicket.Component>, org.apache.wicket.IQueueRegion, org.apache.wicket.markup.html.IHeaderContributor, org.apache.wicket.request.component.IRequestableComponent, org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>, org.apache.wicket.util.io.IClusterable

    public class AccordionPanel
    extends com.googlecode.wicket.jquery.core.JQueryGenericPanel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>>
    implements IAccordionListener
    Provides a jQuery accordion based on a JQueryGenericPanel, which takes ITabs as constructor's argument
    Since:
    1.2.3, 6.0.1
    Author:
    Sebastien Briquet - sebfz1
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget

        com.googlecode.wicket.jquery.core.IJQueryWidget.JQueryWidget
    • Field Summary

      • Fields inherited from class com.googlecode.wicket.jquery.core.JQueryPanel

        options
      • Fields inherited from class org.apache.wicket.markup.html.panel.Panel

        PANEL
      • Fields inherited from class org.apache.wicket.Component

        ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING
    • Constructor Summary

      Constructors 
      Constructor Description
      AccordionPanel​(String id, List<org.apache.wicket.extensions.markup.html.tabs.ITab> tabs)
      Constructor
      AccordionPanel​(String id, List<org.apache.wicket.extensions.markup.html.tabs.ITab> tabs, com.googlecode.wicket.jquery.core.Options options)
      Constructor
      AccordionPanel​(String id, org.apache.wicket.model.IModel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>> model)
      Constructor
      AccordionPanel​(String id, org.apache.wicket.model.IModel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>> model, com.googlecode.wicket.jquery.core.Options options)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLastTabIndex()
      Gets the last visible tab index
      List<org.apache.wicket.extensions.markup.html.tabs.ITab> getModelObject()  
      boolean isActivateEventEnabled()
      Indicates whether the 'activate' event is enabled.
      If true, the IAccordionListener.onActivate(AjaxRequestTarget, int, ITab) event will be triggered on 'activate'

      Warning: 'activate' event is required to be enabled for the AjaxTab to load
      boolean isCreateEventEnabled()
      Indicates whether the 'create' event is enabled.
      If true, the IAccordionListener.onActivate(AjaxRequestTarget, int, ITab) event will be triggered on 'create'

      Warning: 'create' event is required to be enabled for the AjaxTab to load
      protected org.apache.wicket.Component newTitleLabel​(String id, org.apache.wicket.model.IModel<String> title)
      Gets a new Label for the tab's title
      AccordionBehavior newWidgetBehavior​(String selector)  
      void onActivate​(org.apache.wicket.ajax.AjaxRequestTarget target, int index, org.apache.wicket.extensions.markup.html.tabs.ITab tab)
      Triggered when an accordion tab has been activated (on 'create' and/or 'activate' event).
      protected void onInitialize()  
      void reload​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Reloads the AccordionPanel

      Note: This method should be used instead of target.add(tabbedPanel) if the underlying model is-a TabListModel
      AccordionPanel setActiveTab​(int index)
      Activates the selected tab
      void setActiveTab​(int index, org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Activates the selected tab
      Warning: invoking this method results to a dual client-server round-trip.
      • Methods inherited from class com.googlecode.wicket.jquery.core.JQueryPanel

        onBeforeRender, onConfigure
      • Methods inherited from class org.apache.wicket.markup.html.panel.Panel

        getRegionMarkup, newMarkupSourcingStrategy
      • Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer

        getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
      • Methods inherited from class org.apache.wicket.MarkupContainer

        add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onDetach, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
      • Methods inherited from class org.apache.wicket.Component

        add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, 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, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
      • Methods inherited from interface org.apache.wicket.IGenericComponent

        getDefaultModel, getDefaultModelObject, getModel, setDefaultModel, setDefaultModelObject, setModel, setModelObject
      • Methods inherited from interface org.apache.wicket.IQueueRegion

        dequeue, newDequeueContext
    • Constructor Detail

      • AccordionPanel

        public AccordionPanel​(String id,
                              List<org.apache.wicket.extensions.markup.html.tabs.ITab> tabs)
        Constructor
        Parameters:
        id - the markup id
        tabs - the list of ITabs
      • AccordionPanel

        public AccordionPanel​(String id,
                              List<org.apache.wicket.extensions.markup.html.tabs.ITab> tabs,
                              com.googlecode.wicket.jquery.core.Options options)
        Constructor
        Parameters:
        id - the markup id
        tabs - the list of ITabs
        options - the Options
      • AccordionPanel

        public AccordionPanel​(String id,
                              org.apache.wicket.model.IModel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>> model)
        Constructor
        Parameters:
        id - the markup id
        model - the list model of ITabs
      • AccordionPanel

        public AccordionPanel​(String id,
                              org.apache.wicket.model.IModel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>> model,
                              com.googlecode.wicket.jquery.core.Options options)
        Constructor
        Parameters:
        id - the markup id
        model - the list model of ITabs
        options - the Options
    • Method Detail

      • getModelObject

        public List<org.apache.wicket.extensions.markup.html.tabs.ITab> getModelObject()
        Specified by:
        getModelObject in interface org.apache.wicket.IGenericComponent<List<org.apache.wicket.extensions.markup.html.tabs.ITab>,​com.googlecode.wicket.jquery.core.JQueryGenericPanel<List<org.apache.wicket.extensions.markup.html.tabs.ITab>>>
      • setActiveTab

        public AccordionPanel setActiveTab​(int index)
        Activates the selected tab
        Parameters:
        index - the tab's index to activate
        Returns:
        this, for chaining
      • setActiveTab

        public void setActiveTab​(int index,
                                 org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Activates the selected tab
        Warning: invoking this method results to a dual client-server round-trip. Use this method if you cannot use setActiveTab(int) followed by target.add(myTabbedPannel)
        Parameters:
        index - the tab's index to activate
        handler - the IPartialPageRequestHandler
      • getLastTabIndex

        public int getLastTabIndex()
        Gets the last visible tab index
        Returns:
        the tab index, or -1 if none
      • reload

        public void reload​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Reloads the AccordionPanel

        Note: This method should be used instead of target.add(tabbedPanel) if the underlying model is-a TabListModel
        Parameters:
        handler - the IPartialPageRequestHandler
      • onInitialize

        protected void onInitialize()
        Overrides:
        onInitialize in class org.apache.wicket.MarkupContainer
      • onActivate

        public void onActivate​(org.apache.wicket.ajax.AjaxRequestTarget target,
                               int index,
                               org.apache.wicket.extensions.markup.html.tabs.ITab tab)
        Description copied from interface: IAccordionListener
        Triggered when an accordion tab has been activated (on 'create' and/or 'activate' event).
        Specified by:
        onActivate in interface IAccordionListener
        Parameters:
        target - the AjaxRequestTarget
        index - the accordion header that triggered this event
        tab - the ITab that corresponds to the index
      • newTitleLabel

        protected org.apache.wicket.Component newTitleLabel​(String id,
                                                            org.apache.wicket.model.IModel<String> title)
        Gets a new Label for the tab's title
        Parameters:
        id - the markup id
        title - the tab's title model
        Returns:
        a new Label
      • newWidgetBehavior

        public AccordionBehavior newWidgetBehavior​(String selector)
        Specified by:
        newWidgetBehavior in interface com.googlecode.wicket.jquery.core.IJQueryWidget