Class Selectable<T extends Serializable>
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
Children of that container can be selected using the mouse or by pressing ctrl+click
Usage:
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
widgetBehaviorFields 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
ConstructorsConstructorDescriptionSelectable(String id, List<T> items) ConstructorSelectable(String id, org.apache.wicket.model.IModel<? extends List<T>> items) ConstructorConstructorSelectable(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 TypeMethodDescriptionDraggable<?>Creates aDraggableobject that is related to thisSelectable.
Uses a default factory that will create aDraggablewith aui-icon-arrow-4-diagiconDraggable<?>createDraggable(String id, SelectableDraggableFactory factory) Creates aDraggableobject that is related to thisSelectableGets the reference list of all selectable items.protected StringGets the selector that identifies the selectable item within aSelectable
The selector should be the path from theSelectableto the item (for instance '#myUL LI', where '#myUL' is theSelectable's selector)protected com.googlecode.wicket.jquery.core.JQueryAbstractBehaviorGets the JQueryAbstractBehavior in charge of selecting default items (matching model object)com.googlecode.wicket.jquery.core.JQueryBehaviornewWidgetBehavior(String selector) protected voidprotected voidonDetach()voidonSelect(org.apache.wicket.ajax.AjaxRequestTarget target) Triggered when a selection has been made (stops)final voidTriggered when a selection has been made (stops)Methods inherited from class com.googlecode.wicket.jquery.core.JQueryContainer
onBeforeRender, onConfigure, onInitializeMethods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionMethods 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, visitChildrenMethods 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, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.wicket.IGenericComponent
getDefaultModel, getDefaultModelObject, getModel, getModelObject, setDefaultModel, setDefaultModelObject, setModel, setModelObjectMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Selectable
Constructor- Parameters:
id- the markup iditems- the list theSelectableshould observe.
-
Selectable
Constructor- Parameters:
id- the markup iditems- the list theSelectableshould observe.
-
Selectable
public Selectable(String id, org.apache.wicket.model.IModel<? extends List<T>> model, List<T> items) Constructor- Parameters:
id- the markup idmodel- the list of selected itemsitems- the list theSelectableshould 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 idmodel- the list of selected itemsitems- the list theSelectableshould observe.
-
-
Method Details
-
getItemList
Gets the reference list of all selectable items.- Returns:
- the list of all selectable items.
-
getItemSelector
Gets the selector that identifies the selectable item within aSelectable
The selector should be the path from theSelectableto the item (for instance '#myUL LI', where '#myUL' is theSelectable's selector)- Returns:
- "li" by default
-
onConfigure
protected void onConfigure()- Overrides:
onConfigurein classorg.apache.wicket.Component
-
onSelect
public void onSelect(org.apache.wicket.ajax.AjaxRequestTarget target) Triggered when a selection has been made (stops)- Parameters:
target- theAjaxRequestTarget
-
onSelect
Description copied from interface:ISelectableListenerTriggered when a selection has been made (stops)- Specified by:
onSelectin interfaceISelectableListener<T extends Serializable>- Parameters:
target- theAjaxRequestTargetitems- theListof selected items
-
onDetach
protected void onDetach()- Overrides:
onDetachin classorg.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
- Specified by:
newWidgetBehaviorin interfacecom.googlecode.wicket.jquery.core.IJQueryWidget
-
createDraggable
Creates aDraggableobject that is related to thisSelectable.
Uses a default factory that will create aDraggablewith aui-icon-arrow-4-diagicon- Parameters:
id- the markup id- Returns:
- the
Draggable
-
createDraggable
Creates aDraggableobject that is related to thisSelectable- Parameters:
id- the markup idfactory- theSelectableDraggableFactoryinstance- Returns:
- the
Draggable
-