Class FilesSelectedBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.behavior.AbstractAjaxBehavior
-
- org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
-
- org.apache.wicket.ajax.AjaxEventBehavior
-
- org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
-
- org.apache.wicket.ajax.form.OnChangeAjaxBehavior
-
- org.apache.wicket.markup.html.form.upload.FilesSelectedBehavior
-
- All Implemented Interfaces:
Serializable
,IComponentAwareEventSink
,IRequestListener
,IComponentAwareHeaderContributor
,IClusterable
public abstract class FilesSelectedBehavior extends OnChangeAjaxBehavior
OnChangeAjaxBehavior
that streams back to server properties of the selected file(s) (at client side), before uploading it (them).- Author:
- Ernesto Reinaldo Barreiro (reiern70@gmail.com).
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.ajax.form.OnChangeAjaxBehavior
EVENT_CHANGE, EVENT_NAME
-
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
-
-
Constructor Summary
Constructors Constructor Description FilesSelectedBehavior()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
onBind()
Subclasses should call super.onBind()protected abstract void
onSelected(AjaxRequestTarget target, List<FileDescription> fileDescriptions)
Called when a file, at client side is selected.static FilesSelectedBehavior
onSelected(org.danekja.java.util.function.serializable.SerializableBiConsumer<AjaxRequestTarget,List<FileDescription>> select)
Creates anFilesSelectedBehavior
based on lambda expressionsprotected void
onUpdate(AjaxRequestTarget target)
Listener invoked on the ajax request.void
renderHead(Component component, IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section.protected void
updateAjaxAttributes(AjaxRequestAttributes attributes)
Gives a chance to the specializations to modify the attributes.-
Methods inherited from class org.apache.wicket.ajax.form.OnChangeAjaxBehavior
onChange
-
Methods inherited from class org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior
checkComponent, disableFocusOnBlur, getFormComponent, getUpdateModel, onError, onEvent, onUpdate
-
Methods inherited from class org.apache.wicket.ajax.AjaxEventBehavior
getEvent, onEvent, respond
-
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onMethodMismatch, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes
-
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind
-
Methods inherited from class org.apache.wicket.behavior.Behavior
beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
-
-
-
Constructor Detail
-
FilesSelectedBehavior
public FilesSelectedBehavior()
-
-
Method Detail
-
onBind
protected void onBind()
Description copied from class:AbstractDefaultAjaxBehavior
Subclasses should call super.onBind()- Overrides:
onBind
in classAjaxFormComponentUpdatingBehavior
- See Also:
AbstractAjaxBehavior.onBind()
-
onUpdate
protected void onUpdate(AjaxRequestTarget target)
Description copied from class:AjaxFormComponentUpdatingBehavior
Listener invoked on the ajax request. This listener is invoked after the component's model has been updated.Note:
AjaxFormComponentUpdatingBehavior.onError(AjaxRequestTarget, RuntimeException)
is called instead when processing of theFormComponent
failed with conversion or validation errors!- Specified by:
onUpdate
in classAjaxFormComponentUpdatingBehavior
- Parameters:
target
- the current request handler
-
onSelected
protected abstract void onSelected(AjaxRequestTarget target, List<FileDescription> fileDescriptions)
Called when a file, at client side is selected.- Parameters:
target
- TheAjaxRequestTarget
fileDescriptions
- A list of FileDescription
-
updateAjaxAttributes
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
Description copied from class:AbstractDefaultAjaxBehavior
Gives a chance to the specializations to modify the attributes.- Overrides:
updateAjaxAttributes
in classOnChangeAjaxBehavior
-
renderHead
public void renderHead(Component component, IHeaderResponse response)
Description copied from class:Behavior
Render to the web response whatever the component wants to contribute to the head section.- Specified by:
renderHead
in interfaceIComponentAwareHeaderContributor
- Overrides:
renderHead
in classAjaxEventBehavior
- Parameters:
component
- component which is contributing to the response. This parameter is here to give the component as the context for component-awares implementing this interfaceresponse
- Response object- See Also:
Behavior.renderHead(Component, org.apache.wicket.markup.head.IHeaderResponse)
-
onSelected
public static FilesSelectedBehavior onSelected(org.danekja.java.util.function.serializable.SerializableBiConsumer<AjaxRequestTarget,List<FileDescription>> select)
Creates anFilesSelectedBehavior
based on lambda expressions- Parameters:
select
-SerializableBiConsumer
- Returns:
- the
FilesSelectedBehavior
behavior
-
-