public abstract class SelectableAjaxBehavior
extends org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
Sets the attached component selectable behavior. When the user finished to
select some childs components,onSelection(Component[], AjaxRequestTarget)
is called via Ajax.
This behavior contains a SelectableBehavior which is used to control
the options of the selectable, including all the options and event of the
behavior. Example:
SelectableAjaxBehavior selectable = new SelectableAjaxBehavior() {
public void onSelection(Component[] components, AjaxRequestTarget ajaxRequestTarget) {
...
}
}
SelectableBehavior sb = selectable.getSelectableBehavior();
sb.setTolerance(ToleranceEnum.FIT);
add(selectable);
| Constructor and Description |
|---|
SelectableAjaxBehavior()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
JsStatement |
destroy()
Method to destroy
This will return the element back to its pre-init state.
|
void |
destroy(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to destroy within the ajax request
|
JsStatement |
disable()
Method to disable
|
void |
disable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to disable within the ajax request
|
JsStatement |
enable()
Method to enable
|
void |
enable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to enable within the ajax request
|
protected CharSequence |
getCallbackScript(boolean onlyTargetActivePage)
We override super method to add the selected array to the URL.
|
String |
getCancel() |
int |
getDelay() |
int |
getDistance() |
String |
getFilter() |
SelectableBehavior |
getSelectableBehavior() |
SelectableBehavior.ToleranceEnum |
getTolerance() |
boolean |
isAutoRefresh() |
boolean |
isDisabled() |
protected void |
onBind() |
void |
onSelection(org.apache.wicket.ajax.AjaxRequestTarget target)
For framework internal use only.
|
abstract void |
onSelection(org.apache.wicket.Component[] components,
org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
onSelection is triggered at the end of a selection operation.
|
JsStatement |
refresh()
Method to refresh
|
void |
refresh(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to refresh within the ajax request
|
protected void |
respond(org.apache.wicket.ajax.AjaxRequestTarget target) |
SelectableAjaxBehavior |
setAutoRefresh(boolean autoRefresh)
This determines whether to refresh (recalculate) the position and size
of each selected at the beginning of each select operation.
|
SelectableAjaxBehavior |
setCancel(String cancel)
Set's the prevent selecting if you start on elements matching the selector
|
SelectableAjaxBehavior |
setDelay(int delay)
Set's the delay (in milliseconds) to define when the selecting should start
|
SelectableAjaxBehavior |
setDisabled(boolean disabled)
Disables (true) or enables (false) the selectable.
|
SelectableAjaxBehavior |
setDistance(int distance)
Set's the tolerance in pixels
|
SelectableAjaxBehavior |
setFilter(String filter)
Set's the matching child to be selectable
|
SelectableAjaxBehavior |
setTolerance(SelectableBehavior.ToleranceEnum tolerance)
Set's the tolerance
fit: draggable overlaps the droppable entirely
touch: draggable overlaps the droppable any amount
|
protected JsStatement |
statement() |
JsStatement |
widget()
Method to returns the .ui-selectable element
|
void |
widget(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
Method to returns the .ui-selectable element within the ajax request
|
findIndicatorId, generateCallbackScript, getAjaxCallDecorator, getCallbackScript, getChannelName, getFailureScript, getPreconditionScript, getSuccessScript, onRequest, renderHead, throttleScriptbind, getCallbackUrl, getCallbackUrl, getComponent, getImplementationId, getStatelessHint, onComponentRendered, onComponentTag, onComponentTag, onRendered, onRenderHeadContribution, onRenderHeadInitContributionprotected CharSequence getCallbackScript(boolean onlyTargetActivePage)
getCallbackScript in class org.apache.wicket.ajax.AbstractDefaultAjaxBehaviorAbstractDefaultAjaxBehavior.getCallbackScript(boolean)public SelectableBehavior getSelectableBehavior()
protected void onBind()
onBind in class org.apache.wicket.ajax.AbstractDefaultAjaxBehaviorAbstractDefaultAjaxBehavior.onBind()public final void onSelection(org.apache.wicket.ajax.AjaxRequestTarget target)
public abstract void onSelection(org.apache.wicket.Component[] components,
org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
components - List of components selectedajaxRequestTarget - the Ajax targetprotected void respond(org.apache.wicket.ajax.AjaxRequestTarget target)
respond in class org.apache.wicket.ajax.AbstractDefaultAjaxBehaviorAbstractDefaultAjaxBehavior.respond(org.apache.wicket.ajax.AjaxRequestTarget)protected JsStatement statement()
IWiQueryPlugin.statement()public String getCancel()
public int getDelay()
public int getDistance()
public String getFilter()
public SelectableBehavior.ToleranceEnum getTolerance()
public boolean isAutoRefresh()
public SelectableAjaxBehavior setAutoRefresh(boolean autoRefresh)
autoRefresh - public SelectableAjaxBehavior setDisabled(boolean disabled)
disabled - public boolean isDisabled()
public SelectableAjaxBehavior setCancel(String cancel)
cancel - Selector (default : ':input,option')public SelectableAjaxBehavior setDelay(int delay)
delay - public SelectableAjaxBehavior setDistance(int distance)
distance - public SelectableAjaxBehavior setFilter(String filter)
filter - Selector (default : '*')public SelectableAjaxBehavior setTolerance(SelectableBehavior.ToleranceEnum tolerance)
tolerance - public JsStatement destroy()
public void destroy(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement disable()
public void disable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement enable()
public void enable(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement refresh()
public void refresh(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - public JsStatement widget()
public void widget(org.apache.wicket.ajax.AjaxRequestTarget ajaxRequestTarget)
ajaxRequestTarget - Copyright © 2009-2012. All Rights Reserved.