public class AjaxFileDropBehavior extends AjaxEventBehavior
Modifier and Type | Field and Description |
---|---|
static String |
DRAG_OVER_CLASS_KEY |
INDICATOR
Constructor and Description |
---|
AjaxFileDropBehavior()
Listen for 'dragover' and 'drop' events and prevent them, only 'drop' will initiate
an Ajax request.
|
Modifier and Type | Method and Description |
---|---|
Bytes |
getFileMaxSize() |
Bytes |
getMaxSize() |
protected void |
onError(AjaxRequestTarget target,
org.apache.commons.fileupload.FileUploadException fux)
Hook method called to handle any error during uploading of the file.
|
protected void |
onEvent(AjaxRequestTarget target)
Listener method for the ajax event
|
protected void |
onFileUpload(AjaxRequestTarget target,
List<FileUpload> files)
Hook method called after a file was uploaded.
|
void |
renderHead(Component component,
IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section.
|
void |
setFileMaxSize(Bytes fileMaxSize)
Set an optional maximum size per file.
|
void |
setMaxSize(Bytes maxSize)
Set the maximum upload size.
|
protected void |
updateAjaxAttributes(AjaxRequestAttributes attributes)
Gives a chance to the specializations to modify the attributes.
|
getEvent, onEvent, respond
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onMethodMismatch, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind
beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
rendersPage
public static final String DRAG_OVER_CLASS_KEY
public AjaxFileDropBehavior()
public void renderHead(Component component, IHeaderResponse response)
Behavior
renderHead
in interface IComponentAwareHeaderContributor
renderHead
in class AjaxEventBehavior
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 objectBehavior.renderHead(Component,
org.apache.wicket.markup.head.IHeaderResponse)
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
AbstractDefaultAjaxBehavior
updateAjaxAttributes
in class AjaxEventBehavior
protected void onEvent(AjaxRequestTarget target)
AjaxEventBehavior
onEvent
in class AjaxEventBehavior
target
- the current request handlerpublic Bytes getMaxSize()
public void setMaxSize(Bytes maxSize)
maxSize
- maximum size, must not be nullpublic Bytes getFileMaxSize()
public void setFileMaxSize(Bytes fileMaxSize)
fileMaxSize
- maximum size for each uploaded fileprotected void onFileUpload(AjaxRequestTarget target, List<FileUpload> files)
Note: onError(AjaxRequestTarget, FileUploadException)
is called instead when
uploading failed
target
- the current request handlerfiles
- uploaded filesprotected void onError(AjaxRequestTarget target, org.apache.commons.fileupload.FileUploadException fux)
Default implementation re-throws the exception.
target
- the current request handlere
- the error that occurredCopyright © 2006–2022 Apache Software Foundation. All rights reserved.