java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
com.googlecode.wicket.jquery.core.JQueryContainer
com.googlecode.wicket.jquery.core.JQueryGenericContainer<List<T>>
com.googlecode.wicket.jquery.ui.interaction.selectable.Selectable<T>
Type Parameters:
T - the type of the model object
All Implemented Interfaces:
com.googlecode.wicket.jquery.core.IJQueryWidget, ISelectableListener<T>, 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<T>,com.googlecode.wicket.jquery.core.JQueryGenericContainer<List<T>>>, org.apache.wicket.IMetadataContext<Serializable,org.apache.wicket.Component>, 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 Selectable<T extends Serializable> extends com.googlecode.wicket.jquery.core.JQueryGenericContainer<List<T>> implements ISelectableListener<T>
Provides a jQuery UI selectable JQueryGenericContainer.
Children of that container can be selected using the mouse or by pressing ctrl+click
Usage:
 <ul wicket:id="selectable">
        <li wicket:id="items">
                <span wicket:id="item">[label]</span>
        </li>
 </ul>
 
 
 final Selectable<String> selectable = new Selectable<String>("selectable", list) {
 
        protected void onSelect(AjaxRequestTarget target)
        {
                //this.getModelObject(): gets the selected items
        }
 };
 
 this.add(selectable);
 
Author:
Sebastien Briquet - sebfz1
See Also:
  • 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.JQueryContainer

    widgetBehavior

    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, RFLAG_CONTAINER_HAS_REMOVALS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Selectable(String id, List<T> items)
    Constructor
    Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> items)
    Constructor
    Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> model, List<T> items)
    Constructor
    Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> model, org.apache.wicket.model.IModel<? extends List<T>> items)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a Draggable object that is related to this Selectable.
    Uses a default factory that will create a Draggable with a ui-icon-arrow-4-diag icon
    Creates a Draggable object that is related to this Selectable
    protected List<T>
    Gets the reference list of all selectable items.
    protected String
    Gets the selector that identifies the selectable item within a Selectable
    The selector should be the path from the Selectable to the item (for instance '#myUL LI', where '#myUL' is the Selectable's selector)
    protected com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
    Gets the JQueryAbstractBehavior in charge of selecting default items (matching model object)
    com.googlecode.wicket.jquery.core.JQueryBehavior
     
    protected void
     
    protected void
     
    void
    onSelect(org.apache.wicket.ajax.AjaxRequestTarget target)
    Triggered when a selection has been made (stops)
    final void
    onSelect(org.apache.wicket.ajax.AjaxRequestTarget target, List<T> items)
    Triggered when a selection has been made (stops)

    Methods inherited from class com.googlecode.wicket.jquery.core.JQueryContainer

    onBeforeRender, onConfigure, onInitialize

    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, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, 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, getMarkupTag, 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, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onComponentTag, 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 class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.wicket.IGenericComponent

    getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObject

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • Selectable

      public Selectable(String id, List<T> items)
      Constructor
      Parameters:
      id - the markup id
      items - the list the Selectable should observe.
    • Selectable

      public Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> items)
      Constructor
      Parameters:
      id - the markup id
      items - the list the Selectable should observe.
    • Selectable

      public Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> model, List<T> items)
      Constructor
      Parameters:
      id - the markup id
      model - the list of selected items
      items - the list the Selectable should observe.
    • Selectable

      public Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> model, org.apache.wicket.model.IModel<? extends List<T>> items)
      Constructor
      Parameters:
      id - the markup id
      model - the list of selected items
      items - the list the Selectable should observe.
  • Method Details

    • getItemList

      protected List<T> getItemList()
      Gets the reference list of all selectable items.
      Returns:
      the list of all selectable items.
    • getItemSelector

      protected String getItemSelector()
      Gets the selector that identifies the selectable item within a Selectable
      The selector should be the path from the Selectable to the item (for instance '#myUL LI', where '#myUL' is the Selectable's selector)
      Returns:
      "li" by default
    • onConfigure

      protected void onConfigure()
      Overrides:
      onConfigure in class org.apache.wicket.Component
    • onSelect

      public void onSelect(org.apache.wicket.ajax.AjaxRequestTarget target)
      Triggered when a selection has been made (stops)
      Parameters:
      target - the AjaxRequestTarget
    • onSelect

      public final void onSelect(org.apache.wicket.ajax.AjaxRequestTarget target, List<T> items)
      Description copied from interface: ISelectableListener
      Triggered when a selection has been made (stops)
      Specified by:
      onSelect in interface ISelectableListener<T extends Serializable>
      Parameters:
      target - the AjaxRequestTarget
      items - the List of selected items
    • onDetach

      protected void onDetach()
      Overrides:
      onDetach in class org.apache.wicket.MarkupContainer
    • newSelectedBehavior

      protected com.googlecode.wicket.jquery.core.JQueryAbstractBehavior newSelectedBehavior()
      Gets the JQueryAbstractBehavior in charge of selecting default items (matching model object)
      Returns:
      the JQueryAbstractBehavior
    • newWidgetBehavior

      public com.googlecode.wicket.jquery.core.JQueryBehavior newWidgetBehavior(String selector)
      Specified by:
      newWidgetBehavior in interface com.googlecode.wicket.jquery.core.IJQueryWidget
    • createDraggable

      public Draggable<?> createDraggable(String id)
      Creates a Draggable object that is related to this Selectable.
      Uses a default factory that will create a Draggable with a ui-icon-arrow-4-diag icon
      Parameters:
      id - the markup id
      Returns:
      the Draggable
    • createDraggable

      public Draggable<?> createDraggable(String id, SelectableDraggableFactory factory)
      Creates a Draggable object that is related to this Selectable
      Parameters:
      id - the markup id
      factory - the SelectableDraggableFactory instance
      Returns:
      the Draggable